Weird Problem when trying to download an excel file

Topics: Developer Forum, User Forum
Sep 11, 2010 at 6:42 AM

Hi All,

I have been struggling with this problem regarding downloading a xlsx file.  I have tested the demos and they work as expected, so I know my server is properly setup.  Here is the problem:  my script creates an excel sheet,  and then I prepare the headers exactly as listed in the examples and fire off the $objWriter->save('php://output');

My server runs through the process (successfully creates the excel file) but no file download dialog appears.  So I repeated the action with the app Live HTTP Headers listening and again nothing.  But when I click on the "replay" option in the Live HTTP Headers app, it emulates the request and, presto!, the file download dialog appears.  So I really dont get what my web page is doing wrong/differently then when the Live HTTP Headers app makes the request?  Any thoughts?

Thank you,



P.S.  I read line by line my pages HTTP request and the request from the Live HTTP Headers app and they are identical???


below is the HTTP request and return :



POST /sff/admin/index.php?Action=ExportToExcel HTTP/1.1
Host: localhost
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.2; en-US; rv: Gecko/20100722 Firefox/3.6.8 ( .NET CLR 3.5.30729)
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: en-us,en;q=0.5
Accept-Encoding: gzip,deflate
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
Keep-Alive: 115
Connection: keep-alive
X-Requested-With: XMLHttpRequest
Content-Type: application/x-www-form-urlencoded; charset=UTF-8
Referer: http://localhost/sff/admin/index.php?Page=MailingListManager
Content-Length: 22
Cookie: DBGSESSID=40432839920700004%3Bd%3D1%2Cp%3D0%2Cc%3D1; PHPSESSID=nmq917ba4njp93r918j80kjsg4
Pragma: no-cache
Cache-Control: no-cache
HTTP/1.1 200 OK
Date: Sat, 11 Sep 2010 06:37:16 GMT
Server: Apache/2.2.14 (Win32) DAV/2 mod_ssl/2.2.14 OpenSSL/0.9.8l mod_autoindex_color PHP/5.3.1 mod_apreq2-20090110/2.7.1 mod_perl/2.0.4 Perl/v5.10.1
X-Powered-By: PHP/5.3.1
Set-Cookie: DBGSESSID=40432839920700004%3Bd%3D1%2Cp%3D0%2Cc%3D1; path=/;
Expires: Fri, 25 Dec 1980 00:00:00 GMT
Cache-Control: no-cache, must-revalidate
Pragma: no-cache
Last-Modified: Sat, 11 Sep 2010 06:37:16 GMT
Content-Disposition: attachment;filename="SFFMailingList.xlsx"
Keep-Alive: timeout=5, max=100
Connection: Keep-Alive
Transfer-Encoding: chunked
Content-Type: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet