diff options
author | RaNaN <Mast3rRaNaN@hotmail.de> | 2014-04-24 19:46:21 +0200 |
---|---|---|
committer | RaNaN <Mast3rRaNaN@hotmail.de> | 2014-04-24 19:46:21 +0200 |
commit | 3882c7df05418fd017cdbc2ad1bdc97ac0f19644 (patch) | |
tree | 8bc898fd3ad596a7ad3fccaf9f911de0b5d9cc42 | |
parent | fixed clash with new bottle templates (diff) | |
download | pyload-3882c7df05418fd017cdbc2ad1bdc97ac0f19644.tar.xz |
fixed fileupload
-rw-r--r-- | pyload/web/api_app.py | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/pyload/web/api_app.py b/pyload/web/api_app.py index 39747d5ea..e657d688a 100644 --- a/pyload/web/api_app.py +++ b/pyload/web/api_app.py @@ -3,6 +3,7 @@ from urllib import unquote from traceback import format_exc, print_exc +from cStringIO import StringIO from bottle import route, request, response, HTTPError, parse_auth @@ -16,10 +17,8 @@ from pyload.utils import remove_chars # used for gzip compression try: import gzip - from cStringIO import StringIO except ImportError: gzip = None - StringIO = None # gzips response if supported def json_response(obj): @@ -84,7 +83,10 @@ def call_api(func, args=""): # file upload, reads whole file into memory for name, f in request.files.iteritems(): kwargs["filename"] = f.filename - kwargs[name] = f.value + content = StringIO() + f.save(content) + kwargs[name] = content.getvalue() + content.close() # convert arguments from json to obj separately for x, y in request.params.iteritems(): |