Reputation: 929
I try to display "save as" popup on IE using javascript (jquery is ok too).
The expected result is:
I use this code:
window.open("some url on my server", "_self");
and I get:
How can I make it look like in the first picture? as a popup at the bottom of the page, and not modal like I get..
Upvotes: 0
Views: 5225
Reputation: 53246
You can't do this with JavaScript or jQuery. You need to set the HTTP headers of the request as follows:
header('Content-disposition: attachment; filename=excel1.xlsx');
header('Content-type: application/vnd.ms-excel');
The above is a PHP example. Telling the browser to handle the request as an octet stream will prompt the user with the Save As...
dialogue.
Upvotes: 1