import cherrypy
import cgi
from configReader import ConfigReader
import tempfile

class FileFieldStorage(cgi.FieldStorage):
    def make_file(self,binary=None):
        return tempfile.NamedTemporaryFile(delete=True)
def noBodyProcess():
    cherrypy.request.process_request_body = False
    
class Main():
    @cherrypy.expose
    def index(self):
        raise cherrypy.HTTPError(403)
    @cherrypy.expose
    def upload(self,**kwargs):
            cherrypy.request.body.process()
            parts = cherrypy.request.params['file']
            outFile = open('/home/ollien-data/screenshots/'+cherrypy.request.params['name'],'w')
            for part in parts:
                outFile.write(part.fullvalue())
            outFile.close()
            print 'written!'
cherrypy.server.socket_host = '0.0.0.0'
cherrypy.quickstart(Main())

@@ -69,228 +69,143 @@
 ort 
-tempfile%0A%0Aclass FileFieldStorage(cgi.FieldStorage):%0A    def make_file(self,binary=None):%0A        return tempfile.NamedTemporaryFile(delete=True)%0Adef noBodyProcess():%0A    cherrypy.request.process_request_body = False%0A    
+os.path%0Aimport tempfile%0A%0AconfigReader = ConfigReader(name=%22serverConfig.txt%22)%0Akeys = configReader.getKeys()%0Alocation = keys%5B'location'%5D
 %0Acla
@@ -474,41 +474,30 @@
 pen(
-'/home/ollien-data/screenshots/'+
+os.path.join(location,
 cher
@@ -523,16 +523,17 @@
 %5B'name'%5D
+)
 ,'w')%0A  

Remove proprietary code