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):