How to download dynamically generated file?

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
ilsoph
Forum Newbie
Posts: 1
Joined: Thu Oct 11, 2007 3:32 pm

How to download dynamically generated file?

Post by ilsoph »

I'm trying to download a generated file via:

GET /lalala.html?a_lot_of_parameters=1&get_lead_info=Download+Optional+Info HTTP/1.1 Host: some.server.com Cookie: PHPSESSID=38333395e6398831242896875df9b5f0 Connection: Close

i get this back:

HTTP/1.1 200 OK Date: Thu, 11 Oct 2007 20:32:11 GMT Server: Vary: Host X-Server-Name: www@web36 P3P: policyref="/w3c/p3p.xml", CP="NOR NOI DSP COR ADM OUR PHY" Content-disposition: filename=1192134731.csv Cache-Control: none, must-revalidate, max-age=0 Expires: 0 Transfer-Encoding: chunked Content-Type: application/csv Connection: close 1 0

i don't know how or what to do to receive the CSV file (1192134731.csv).

Any help would be appreciated, thank you!
User avatar
Mordred
DevNet Resident
Posts: 1579
Joined: Sun Sep 03, 2006 5:19 am
Location: Sofia, Bulgaria

Post by Mordred »

Please post with correct newlines so we can be certain what's going on.
From what I see it looks like you are getting the file correcty, only it contains just a 1 and a 0.
Also, how do you make the request, are you using PHP sockets? If so, pay attention to that Connection: close header.
Also (if using sockets) do you properly half-close the socket?
Post Reply