Quantcast
Channel: User Ciprian Tarta - Stack Overflow
Viewing all articles
Browse latest Browse all 31

Answer by Ciprian Tarta for python django - csv file not getting downloaded in IE 8

$
0
0

Try this:

csv_name = urllib.urlencode({'filename':'"results.csv"'})  #this is if you really really want the double quotes, otherwise just use cvs_name = 'results.csv'response = HttpResponse(csv_content, mimetype='text/csv')response['Content-Disposition'] = 'attachment; '+ csv_name +'.csv'response['Content-Type']        = 'text/csv; charset=utf-8';return response

Also, the urlencode is useful in case you have spaces, pluses, minuses in the file name. Otherwise IE will not work.


Viewing all articles
Browse latest Browse all 31

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>