summaryrefslogtreecommitdiffstats
path: root/pyload/web/api_app.py
diff options
context:
space:
mode:
authorGravatar RaNaN <Mast3rRaNaN@hotmail.de> 2013-09-11 12:27:33 +0200
committerGravatar RaNaN <Mast3rRaNaN@hotmail.de> 2013-09-11 12:27:33 +0200
commit3c6887b839507e8c4029c1028d55846cbbfd845e (patch)
tree3f44337324d3d91cfaacfcd02964f3171eafbdcf /pyload/web/api_app.py
parentimproved link grabber (diff)
downloadpyload-3c6887b839507e8c4029c1028d55846cbbfd845e.tar.xz
container upload and url parser for linkgrabber
Diffstat (limited to 'pyload/web/api_app.py')
-rw-r--r--pyload/web/api_app.py9
1 files changed, 7 insertions, 2 deletions
diff --git a/pyload/web/api_app.py b/pyload/web/api_app.py
index b13e3bed9..66cdd58fd 100644
--- a/pyload/web/api_app.py
+++ b/pyload/web/api_app.py
@@ -2,7 +2,6 @@
# -*- coding: utf-8 -*-
from urllib import unquote
-from itertools import chain
from traceback import format_exc, print_exc
from bottle import route, request, response, HTTPError, parse_auth
@@ -60,8 +59,14 @@ def call_api(func, args=""):
if request.json:
kwargs = request.json
+ # file upload, reads whole file into memory
+ for name, f in request.files.iteritems():
+ print f.length
+ kwargs["filename"] = f.filename
+ kwargs[name] = f.value
+
# convert arguments from json to obj separately
- for x, y in chain(request.GET.iteritems(), request.POST.iteritems()):
+ for x, y in request.params.iteritems():
if not x or not y or x == "session": continue
kwargs[x] = loads(unquote(y))