File transfer works

pull/3/head
assar 8 years ago
parent 64c6849c29
commit 550d79910e

@ -66,8 +66,19 @@ def alter(partID):
file = request.files['file']
filename = secure_filename(file.filename)
file.save(os.path.join('/srv/datasheets', filename))'''
print dict(request.data)
print dict(request.files)
print 'Form:', request.form
print ' '
print 'Files:', request.files
if len(request.files) == 0:
print 'No file :('
else:
print 'Oooh look, a file! :)'
somefile = request.files['datasheet-file']
print somefile.filename
filename = secure_filename(somefile.filename)
somefile.save('/home/davide/' + filename)
print "Now it's mine"
return '{"status":"ok"}'
def connect(user, password, db, host='localhost', port=5432):
'''Returns a connection and a metadata object'''

Loading…
Cancel
Save