summaryrefslogtreecommitdiffstats
path: root/module/web/json_app.py
diff options
context:
space:
mode:
authorGravatar RaNaN <Mast3rRaNaN@hotmail.de> 2011-02-05 22:59:54 +0100
committerGravatar RaNaN <Mast3rRaNaN@hotmail.de> 2011-02-05 22:59:54 +0100
commitff7d460b120ce987be93fc242b0447f85c00c759 (patch)
tree972020abaaf096ef3f085690840c8d0857cb983e /module/web/json_app.py
parentsetup fix (diff)
downloadpyload-ff7d460b120ce987be93fc242b0447f85c00c759.tar.xz
webif dlc upload fix
Diffstat (limited to 'module/web/json_app.py')
-rw-r--r--module/web/json_app.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/module/web/json_app.py b/module/web/json_app.py
index 2c95eaf5b..12b7fa8ce 100644
--- a/module/web/json_app.py
+++ b/module/web/json_app.py
@@ -4,6 +4,7 @@
import base64
from os.path import join
from traceback import print_exc
+from shutil import copyfileobj
from bottle import route, request, HTTPError, validate
@@ -220,10 +221,9 @@ def add_package():
if name is None or name == "":
name = f.name
- fpath = join(PYLOAD.get_conf_val("general", "download_folder"), "tmp_" + f.name)
+ fpath = join(PYLOAD.get_conf_val("general", "download_folder"), "tmp_" + f.filename)
destination = open(fpath, 'wb')
- for chunk in f.chunks():
- destination.write(chunk)
+ copyfileobj(f.file, destination)
destination.close()
links.insert(0, fpath)
except: