I have the following view in my views.py -
class FilterView(generics.ListAPIView):
model = cdx_composites_csv
def get(self, request, format=None):
Try using FileWrapper:
from django.core.servers.basehttp import FileWrapper
...
if format == 'raw':
zip_file = open('C:\temp\core\files\CDX_COMPOSITES_20140626.zip', 'rb')
response = HttpResponse(FileWrapper(zip_file), content_type='application/zip')
response['Content-Disposition'] = 'attachment; filename="%s"' % 'CDX_COMPOSITES_20140626.zip'
return response
...
Also, I would use application/zip instead of application/force-download.