473,387 Members | 1,592 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Create text file and download

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
3 2032

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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Dale | last post by:
I am trying to figure out how to have a script dynamically create and then dispose of a text file. A script will generate a text file using the standard I/O functions and then present a link so...
9
by: Lauren Quantrell | last post by:
Is there a way to create a text file (such as a Windows Notepad file) by using a trigger on a table? What I want to do is to send a row of information to a table where the table: tblFileData has...
6
by: Chad Crowder | last post by:
Getting the following error on my production server whether the file exists or not: "System.IO.IOException: Cannot create a file when that file already exists." Here's the code generating the...
7
by: theyas | last post by:
How can I get my code to NOT display two "Open/Save/Cancel/More Info" dialog boxes when using the "Response.WriteFile" method to download a file to IE I've asked about this before and didn't get a...
11
by: Russ Green | last post by:
I need help writing a method to create a simple text file. I want that file to be saved to a local drive (client side of my asp.net app). The filename will always be the same "license.txt" but the...
6
by: windandwaves | last post by:
Hi Folk Some of my clients asked me to create "fancy emails" for them (aka html formatted emails). I know how to make a nice html document, but I had trouble creating a simple way to provide...
6
by: Parrot | last post by:
I am using WebClient to download a file from a server in my webpage. How can I create a dialog that asks the client for a download path? Now I am just hardcoding a directory path for the...
4
by: Vlad | last post by:
I am having problems using the file.create method within a function that is called when looping through an array of filepaths. If I call my function with a hardcoded file path --C:\Temp.txt the...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.