By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,952 Members | 985 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,952 IT Pros & Developers. It's quick & easy.

Create text file and download

P: n/a
Hi folks,

Excuse if this has been asked before, and by all means just point me at
a thread if thats a suitable response.

I have a mySql database which I am running various queries against. Can
anyone suggest a way of creating a text file which is downloaded to the
user. In particuar is there a way of doing this without creating the
file on the server. In other words create it as a temp file as such and
then download that.

Hope this makes sense.

Thanks in advance

Jun 23 '06 #1
Share this Question
Share on Google+
3 Replies


P: n/a

Simon Rigby wrote:
Can
anyone suggest a way of creating a text file which is downloaded to the
user.


Output plain text and use header() to set the following headers:
Content-type: text/plain
Content-disposition: attachment; filename=myfile.txt

Jun 23 '06 #2

P: n/a
a text file of what?

Simon Rigby wrote:
Hi folks,

Excuse if this has been asked before, and by all means just point me at
a thread if thats a suitable response.

I have a mySql database which I am running various queries against. Can
anyone suggest a way of creating a text file which is downloaded to the
user. In particuar is there a way of doing this without creating the
file on the server. In other words create it as a temp file as such and
then download that.

Hope this makes sense.

Thanks in advance


Jun 23 '06 #3

P: n/a
Many Thanks

Sjoerd wrote:
Simon Rigby wrote:
Can
anyone suggest a way of creating a text file which is downloaded to the
user.


Output plain text and use header() to set the following headers:
Content-type: text/plain
Content-disposition: attachment; filename=myfile.txt


Jun 23 '06 #4

This discussion thread is closed

Replies have been disabled for this discussion.