0
대만 출신이기 때문에 영어가 좋지 않아 문제를 설명하려고 노력합니다.django 다중 파일 다운로드
큰 파일을 다운로드하기 위해 FileWrapper를 사용하고 있지만 단일 응답으로 여러 파일을 다운로드하는 방법을 모르겠습니다. 다른 어떤 방법을 사용할 수 있습니까?
try:
mms = message.objects.get(token=token)
except message.DoesNotExist:
return HttpResponse('ret=1&msg=Invalid arguments&')
try:
attach = mms.message_attach_set.get(id = int(attach_id))
except message_attach.DoesNotExist:
return HttpResponse('ret=1&msg=Invalid arguments&')
response = HttpResponse(FileWrapper(attach.file), mimetype='application/force-download')
response['Content-Length'] = str(attach.file.size)
response['X-Sendfile'] = '%s' % (attach.realName)
return response
입니다. 그런데이 파일들은 멀티미디어에서 분리됩니다. 그래서 내가이 파일들을 다운로드 할 때, 나는이 파일들을 결합해야만한다. –