|
|
|
@ -13,7 +13,7 @@ print ()
|
|
|
|
|
# print "Hello", method
|
|
|
|
|
# cgi.print_environ()
|
|
|
|
|
|
|
|
|
|
UPLOADS = "/var/www/uploads/"
|
|
|
|
|
from settings import UPLOAD_DIR
|
|
|
|
|
|
|
|
|
|
def upload (inputname, upload_dir):
|
|
|
|
|
form = cgi.FieldStorage()
|
|
|
|
@ -31,7 +31,7 @@ def upload (inputname, upload_dir):
|
|
|
|
|
return bytes, fileitem.filename
|
|
|
|
|
|
|
|
|
|
if method == "POST":
|
|
|
|
|
result = upload("thefile", UPLOADS)
|
|
|
|
|
result = upload("thefile", UPLOAD_DIR)
|
|
|
|
|
if result:
|
|
|
|
|
bytes, filename = result
|
|
|
|
|
print ("{0} bytes written to {1}<br />".format(bytes, filename))
|
|
|
|
|