Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Rhinorhino on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to download a file assistance 1

Status
Not open for further replies.

rrsub

MIS
Joined
Oct 23, 2002
Messages
536
Location
US
I have a script that creates a .CSV file.

How can I have the file passed through the browser without the end user downloading it?

In other words, user clicks a button, CSV is created, user downloads file automatically, file is deleted from server.
 
It would not even be necessary to write the file to the server's filesystem.

The user clicks a link, which points to a PHP script. That script will send two HTTP headers: a "Content-type: text/plain" header and a "Content-Disposition: attachment; filename=thefile.csv" header then stream the file to the browser.



Want the best answers? Ask the best questions!

TANSTAAFL!!
 
That's what I needed to know.

Thanks!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top