Basic file upload WSGI application (python >=2.6.x/>=3.x)
This script brings up a simple_server from python's wsgiref package and runs a really simple WSGI (PEP 3333) application on it. It allows to upload any file using multipart/form-data form content type.
Don't use it in production environment as it has not been reviewed for security issues, however it's handy for ad-hoc file transfers between machines over HTTP protocol.
No installation is necessary. Just download the latest version.
-
stand alone:
python fup.py [-h] [--host HOST] [-v] [port]
-
with gunicorn:
gunicorn [-b HOST] --access-logfile - fup:app
-
in order to be able to accept big files and avoid "worker timeouts" it is desirable to use asynchronous (eventlet, gevent or tornado) worker classes:
gunicorn [-b HOST] -k eventlet --access-logfile - fup:app gunicorn [-b HOST] -k gevent --access-logfile - fup:app gunicorn [-b HOST] -k tornado fup:app
-
with Twisted Web:
twistd -n web [--port PORT] --wsgi fup.app
-
with uWSGI:
uwsgi --plugin python --http :[PORT] --wsgi-file fup.py --callable app
pyfup is released under the BSD 2-Clause license. See the LICENSE for more details.
The script was tested and is known to work with python versions 2.7.2, 2.7.3, 2.7.5, 3.3.0, 3.3.2 and 3.3.3 on linux and windows, but should also work on python version >=2.6.x.