php - download file from ajax -


i'm setting html exporting excel , doing via jquery $.post. result data

$.post('/exporttoexcel.php', function(data) {         // data file want download now... how trigger it? }); 

data returned value (the file) server, doing alert(data) output bigger window full of lol. how trigger file able download?

you cannot using ajax. load file in iframe, , send http header file:

content-disposition: attachment 

Comments

Popular posts from this blog

c# - how to write client side events functions for the combobox items -

exception - Python, pyPdf OCR error: pyPdf.utils.PdfReadError: EOF marker not found -