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 Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Download

Status
Not open for further replies.

buzzt

Programmer
Joined
Oct 17, 2002
Messages
171
Location
CA
I have a script to convert MySQL to CSV. What I need to do is have the page prompt the user to download the file rather than have it open in the browser. How would I do this?
 
If the script writes the file to the server's filesystem and you provide a link, not much other than change the file extension of the file to something bizarre.

If the script is streaming the file to the browser, you can use the "Content-disposition" header. Take a look at the PHP online manual under header() to see an example ( , just before the user-supplied comments).

Keep in mind that versions of IE tend to ignore this header at will, particularly if it has a default action for the file type.

Want the best answers? Ask the best questions: TANSTAAFL!!
 
Perfect! Thanks a lot.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top