changed cgi

master
Michael Murtaugh 5 years ago
parent 0b17ed1171
commit dc4a3a0351

@ -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))

Loading…
Cancel
Save