@jelatinauthorNov 17.2009 — #If I load the php script directly in the browser, it prompts the browser to download an XLS (spreadsheet) file.
If I call the script via AJAX, nothing happens, the response from the server is just a set of symbols. I want the AJAX to return the info and prompt the spreadsheet download.
@slaughtersNov 17.2009 — #You can force your browser to think a web page is a XLS file by using the content type meta-tag [code=html]<META HTTP-EQUIV='Content-Type' CONTENT='application/vnd.ms-excel'>[/code]
I expect the PHP file is doing something like this - ie dynamically generating a page that includes the meta tag (or just adds to the page header via a header("Content-Type: application/vnd.ms-excel"); ) so that when your browser sees it for the first time it looks like an XLS file to it.
I don't think you can modify the header to an already existing page - but you may be able to reassign the src of a hidden iframe to point to the new generated content.