Downloading a created txt 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
User avatar
Skywalker
Forum Contributor
Posts: 117
Joined: Thu Aug 29, 2002 3:33 am
Location: The Netherlands

Downloading a created txt file.....!

Post by Skywalker »

Is it posible that the created text file that is generated by an web forum you can download it, insted of showing it in the browser when you klick on it?

If this is posible how can I do this and wher can I find some info about this subtject?




Greathings Skywalker
User avatar
volka
DevNet Evangelist
Posts: 8391
Joined: Tue May 07, 2002 9:48 am
Location: Berlin, ger

Post by volka »

can be done with a Content-Disposition header.
Take a look at the header() manual page
Bitmaster
Forum Newbie
Posts: 20
Joined: Thu Nov 21, 2002 8:42 am

Post by Bitmaster »

Be careful with concurrency issues...Think about what happens when two users request the same functionality and the contents of the files they require is different...So i would not recommend actually generating a physical text file on the server for download, just output the contents of the file from a PHP script with the appropriate headers as suggested above, generated dynamically upon each request.
User avatar
Skywalker
Forum Contributor
Posts: 117
Joined: Thu Aug 29, 2002 3:33 am
Location: The Netherlands

Post by Skywalker »

Ok thx for the information ;)
Post Reply