neylitalo Posted July 11, 2007 Share Posted July 11, 2007 I'm using a script to send a GET request to a particular page which generates and sends an Excel file using the PEAR Spreadsheet::Excel::Writer library, and it works absolutely fine when I just put the URL in the address bar. However, when I'm using an AJAX request, it doesn't actually send the file. I get the correct HTTP response (Firebug ftw!), but I never get the file download dialog. As I see it, there are two possibilities, neither of which are very appealing: The headers attached to that file are ignored when they come through in an XMLHttpRequest response, or I need to do something extra to get it to send the file to the browser. Has anybody had any similar experiences? Quote Link to comment Share on other sites More sharing options...
neylitalo Posted July 11, 2007 Author Share Posted July 11, 2007 Solved - I was using the onclick attribute of the <a> element to trigger the AJAX call, where the href attribute worked much better. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.