|
|
@ -17,7 +17,7 @@ UPLOADS = "/var/www/uploads/"
|
|
|
|
|
|
|
|
|
|
|
|
def upload (inputname, upload_dir):
|
|
|
|
def upload (inputname, upload_dir):
|
|
|
|
form = cgi.FieldStorage()
|
|
|
|
form = cgi.FieldStorage()
|
|
|
|
if not form.has_key(inputname): return
|
|
|
|
if not inputname in form: return
|
|
|
|
fileitem = form[inputname]
|
|
|
|
fileitem = form[inputname]
|
|
|
|
if not fileitem.file: return
|
|
|
|
if not fileitem.file: return
|
|
|
|
fp = os.path.join(upload_dir, fileitem.filename)
|
|
|
|
fp = os.path.join(upload_dir, fileitem.filename)
|
|
|
|