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
Post a Comment