我想在&f; comic \ picture \ jepp'上传zip文件。我使用这段代码:
def sendjepp(request):
docuPath ='F:comic\picture\jepp'
temp = tempfile.TemporaryFile()
f = zipfile.ZipFile(temp, 'w', zipfile.ZIP_DEFLATED)
for dirpath,dirnames,filenames in os.walk(docuPath):
for filename in filenames:
f.write(os.path.join(dirpath,filename))
# f.close()
wrapper = FileWrapper(temp)
response = HttpResponse(wrapper, content_type='application/zip')
response['Content-Disposition'] = 'attachment; filename=test.zip'
response['Content-Length'] = temp.tell()
temp.seek(0)
return response
我收到此错误: