From 818176f58af6ffa8ff8d9d7071c8d8c2c38af476 Mon Sep 17 00:00:00 2001 From: caoqianming Date: Wed, 16 Jun 2021 11:40:06 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A4=A7=E6=96=87=E4=BB=B6=E5=88=86=E5=9D=97?= =?UTF-8?q?=E4=BF=9D=E5=AD=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- safesite/edu/views.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/safesite/edu/views.py b/safesite/edu/views.py index 45b269f5..5240a680 100644 --- a/safesite/edu/views.py +++ b/safesite/edu/views.py @@ -48,7 +48,8 @@ def upload(req): filepath = os.path.join(user_upload_folder, file_name) filepath = filepath.replace('\\','/') with open( filepath, 'wb') as f: - f.write(req.FILES['mf'].read()) + for i in req.FILES['mf'].chunks(): + f.write(i) return JsonResponse({"code":1,"filename":file_name,"filepath":filepath}) #查询 def selectDate(req):