I have currently a small gevent Python application serving HTML files. I would like to be able to upload a small file.
A form is made to send a file to the /file_upload
path.
What should I do to receive the file on the Python side to save it on disk?
Currently I am sending a 200 OK
response:
def __call__(self, environ, start_response):
"""function used to serve files following an http request"""
path = environ['PATH_INFO'].strip('/') or 'index.html'
if path == 'file_upload':
start_response('200 OK',[('Content-Type', 'text/html')])
return 'OK'