# Path: config/config.py



import os
import time
import zipfile
from BaseHTTPServer import BaseHTTPRequestHandler
from StringIO import StringIO
from config.config import MaildbRoot, reportRoot
from HTMLParser import HTMLParser, HTMLParseError
#!/usr/bin/env python
'''
Copyright (C) 2012-2013 Kevin Breen.
This file is part of the Maildb web application
See the 'LICENSE' File for copying permission.
'''



def fileUpload(data, uploadDir):
	print uploadDir
	raw = data.file.read()
	filename = data.filename
	print filename
	if not os.path.exists(uploadDir):
		os.mkdir(uploadDir)
	f = open(os.path.join(uploadDir, filename), "wb")
	f.write(raw)
	f.close()
	print filename
	return filename	

def exportFile(msg_id, inFile):
	expFile = os.path.join(MaildbRoot, "web", "static", "downloads", "Export.zip")

# Path: config/config.py



# Path: core/common.py
import os
import time
import zipfile
from BaseHTTPServer import BaseHTTPRequestHandler
from StringIO import StringIO
from config.config import MaildbRoot, reportRoot
from HTMLParser import HTMLParser, HTMLParseError

#!/usr/bin/env python
'''
Copyright (C) 2012-2013 Kevin Breen.
This file is part of the Maildb web application
See the 'LICENSE' File for copying permission.
'''



def fileUpload(data, uploadDir):
	print uploadDir
	raw = data.file.read()
	filename = data.filename
	print filename
	if not os.path.exists(uploadDir):
		os.mkdir(uploadDir)
	f = open(os.path.join(uploadDir, filename), "wb")
	f.write(raw)
	f.close()
	print filename
	return filename	

def exportFile(msg_id, inFile):
	expFile = os.path.join(MaildbRoot, "web", "static", "downloads", "Export.zip")

	filePath = os.path.join(reportRoot, msg_id, "Case_Files", inFile)