download - django zip file doesn't get downloaded -
i want download zip files using django views
. have gone through many solutions in stack overflow. file not downloaded @ all. here code using.
could anyone, tell me going wrong.
response = httpresponse(mimetype='application/zip') response['content-disposition'] = 'attachment; filename=%s' % doc[zip_file_name] response['x-sendfile'] = "./zipfiles" # path zip files stored homecoming response
in chrome
, if utilize inspect element
, , double click on url
shown in network
tab, file gets downloaded recognized http
request, whereas on button click
nil happens.
please help.
from django.http import httpresponse django.core.servers.basehttp import filewrapper # file response = httpresponse(filewrapper(myfile), content_type='application/zip') response['content-disposition'] = 'attachment; filename=myfile.zip' homecoming response
django download
No comments:
Post a Comment