Closed radek-anuszewski closed 8 years ago
The idea behind the netius WSGIServer is just to provide a thin layer of compatibility/conformance with the WSGI standard. To be able to (more easily) interact with the contents of the HTTP request you should use a framework like (our) Appier Framework (https://github.com/hivesolutions/appier/).
Here's an example of an appier app to read the file contents of a multipart post request.
import appier
class HelloFileApp(appier.App):
@appier.route("/", "POST")
def file_example(self):
file = self.field("file")
return file.read()
HelloFileApp().serve()
BTW by default Appier tries to use netius as the WSGI server :)
Hi!
At first I want to thank you for great working library, which is easy to use and play nice with use cases in our projects. When file is sent to server (using Cordova File Transfer plugin) from our hybrid app, content of
environment['wsgi.input'].getvalue()
is:And when I need to get text content of uploaded file, I have to manually slice
environment['wsgi.input']
to get content (to get dispose of boundaries,Content
info etc..):Is there a way in your library to get content of uploaded file out of the box, without the need to slice
environment['wsgi.input']
maually?Thank you in advance for reply, Radek from Techmetria.