Answer the question
In order to leave comments, you need to log in
How to save a file (ajax request)?
ajax send a GET request to the server
then the server returns the xsl file, implementation :
response = HttpResponse(content_type='application/json')
response['Content-Disposition'] = 'attachment; filename="team_maxes.xlsx"'
wb = xlwt.Workbook()
....
return response
success: function (data) {
var bb = new Blob([data],{ type: 'application/vnd.ms-excel;charset=utf-8;',endings:'native'});
var bUrl = URL.createObjectURL(bb);
window.open(bUrl,"_self");
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question