I need to set the MIME type to application/vnd.ms-excel in a pop out window. How can I do this in Javascript? I tried document.open("application/vnd.ms-excel");
But, it doesn't work.
You can't set the headers client-side. You would have to do this server-side. Do you have something like php avaiable? If so, output the header from php then start streaming the content file (again, using php).
The only javascript part is the initial window.open() call that requests a php file that might take an excel file name as a passed parameter.
Best to post the request in the server-side forum that matches your environment (php, asp, jsp, cfm etc).
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.