File transfer works

master
assar 8 years ago
parent 64c6849c29
commit 550d79910e

@ -66,8 +66,19 @@ def alter(partID):
file = request.files['file'] file = request.files['file']
filename = secure_filename(file.filename) filename = secure_filename(file.filename)
file.save(os.path.join('/srv/datasheets', filename))''' file.save(os.path.join('/srv/datasheets', filename))'''
print dict(request.data) print 'Form:', request.form
print dict(request.files) 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): def connect(user, password, db, host='localhost', port=5432):
'''Returns a connection and a metadata object''' '''Returns a connection and a metadata object'''

Loading…
Cancel
Save