473,395 Members | 1,386 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,395 software developers and data experts.

Creating a downloadable file on the fly

Hi everyone,

I like to export some data from the database and allow my users to store
this file to their harddrive as a .txt file. Does anyone know how I would
go about doing that? (without creating the actual physical text file on my
local drive first).
Thank you
Maziar A.
Nov 18 '05 #1
9 3034
Here's a couple good tutorials on the subject for you:
http://www.aspnetpro.com/features/20...200307so_f.asp
http://aspalliance.com/das/tutorial/fileupload.aspx

--
I hope this helps,
Steve C. Orr, MCSD, MVP
http://Steve.Orr.net
Hire top-notch developers at http://www.able-consulting.com

"Maziar Aflatoun" <ma***@rogers.com> wrote in message
news:hI*********************@news01.bloor.is.net.c able.rogers.com...
Hi everyone,

I like to export some data from the database and allow my users to store
this file to their harddrive as a .txt file. Does anyone know how I would
go about doing that? (without creating the actual physical text file on my
local drive first).
Thank you
Maziar A.

Nov 18 '05 #2
Maybe I did not explain myself right. I don't want to upload files to the
server. I want to allow the user (person browsing my website) to download a
dynamically created text file without actually creating the file on the
local machine. So the user would see something like 'Save as' where then
they can store the file to their local hard-drive.

Any idea?

"Maziar Aflatoun" <ma***@rogers.com> wrote in message
news:hI*********************@news01.bloor.is.net.c able.rogers.com...
Hi everyone,

I like to export some data from the database and allow my users to store
this file to their harddrive as a .txt file. Does anyone know how I would
go about doing that? (without creating the actual physical text file on my
local drive first).
Thank you
Maziar A.

Nov 18 '05 #3
have a look at http://www.devasp.net/net/search/default.asp?c_id=1122

Hope this helps

HD
"Maziar Aflatoun" <ma***@rogers.com> wrote in message
news:At*******************@news04.bloor.is.net.cab le.rogers.com...
Maybe I did not explain myself right. I don't want to upload files to the server. I want to allow the user (person browsing my website) to download a dynamically created text file without actually creating the file on the
local machine. So the user would see something like 'Save as' where then
they can store the file to their local hard-drive.

Any idea?

"Maziar Aflatoun" <ma***@rogers.com> wrote in message
news:hI*********************@news01.bloor.is.net.c able.rogers.com...
Hi everyone,

I like to export some data from the database and allow my users to store
this file to their harddrive as a .txt file. Does anyone know how I would go about doing that? (without creating the actual physical text file on my local drive first).
Thank you
Maziar A.


Nov 18 '05 #4
Here's an article that expains how to create Excel files, and Tab Delimited
text files:
http://www.aspnetpro.com/NewsletterA...200309so_l.asp

--
I hope this helps,
Steve C. Orr, MCSD, MVP
http://Steve.Orr.net
Hire top-notch developers at http://www.able-consulting.com

"Maziar Aflatoun" <ma***@rogers.com> wrote in message
news:At*******************@news04.bloor.is.net.cab le.rogers.com...
Maybe I did not explain myself right. I don't want to upload files to the server. I want to allow the user (person browsing my website) to download a dynamically created text file without actually creating the file on the
local machine. So the user would see something like 'Save as' where then
they can store the file to their local hard-drive.

Any idea?

"Maziar Aflatoun" <ma***@rogers.com> wrote in message
news:hI*********************@news01.bloor.is.net.c able.rogers.com...
Hi everyone,

I like to export some data from the database and allow my users to store
this file to their harddrive as a .txt file. Does anyone know how I would go about doing that? (without creating the actual physical text file on my local drive first).
Thank you
Maziar A.


Nov 18 '05 #5
Here's an article that expains how to create Excel files, and Tab Delimited
text files:
http://www.aspnetpro.com/NewsletterA...200309so_l.asp

--
I hope this helps,
Steve C. Orr, MCSD, MVP
http://Steve.Orr.net
Hire top-notch developers at http://www.able-consulting.com

"Maziar Aflatoun" <ma***@rogers.com> wrote in message
news:At*******************@news04.bloor.is.net.cab le.rogers.com...
Maybe I did not explain myself right. I don't want to upload files to the server. I want to allow the user (person browsing my website) to download a dynamically created text file without actually creating the file on the
local machine. So the user would see something like 'Save as' where then
they can store the file to their local hard-drive.

Any idea?

"Maziar Aflatoun" <ma***@rogers.com> wrote in message
news:hI*********************@news01.bloor.is.net.c able.rogers.com...
Hi everyone,

I like to export some data from the database and allow my users to store
this file to their harddrive as a .txt file. Does anyone know how I would go about doing that? (without creating the actual physical text file on my local drive first).
Thank you
Maziar A.


Nov 18 '05 #6
I hear what you are asking, but... just in case someone doesn't come up with
a good idea, I will let you know what I do.

I make a temp folder on the website. When a user clicks on a link to "Make"
a file (I build pdf's with Crystal Reports), I create a folder and name it
with the Session.SessionID value. Then I place the file in that folder and
the next page displays a link to the file.

When the Session expires, I delete the folder.

Both events for creating and destroying the folders are handled in
global.asax.vb using Session_Start and Session_End

This sounds like more work than something simple that would stream the data,
but I haven't figured that one out yet either...

--
Jerry Boone
Analytical Technologies, Inc.
http://www.antech.biz
Secure Hosting and Development Solutions for ASP, ASP.NET, SQL Server, and
Access

"Maziar Aflatoun" <ma***@rogers.com> wrote in message
news:hI*********************@news01.bloor.is.net.c able.rogers.com...
Hi everyone,

I like to export some data from the database and allow my users to store
this file to their harddrive as a .txt file. Does anyone know how I would
go about doing that? (without creating the actual physical text file on my
local drive first).
Thank you
Maziar A.

Nov 18 '05 #7
The tricky part is getting a FileStream to work with. When the file is
uploaded, it is not in a stream format, but in a text format (encoded
binary). I'm not sure how you would do it offhand, but you would have to
convert it to a FileStream to output it to the Response.OutputStream.

--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
Big things are made up
of lots of little things.

"Jerry Boone" <je***@antech.biz.killspam> wrote in message
news:Gc*******************@newssvr11.news.prodigy. com...
I hear what you are asking, but... just in case someone doesn't come up with a good idea, I will let you know what I do.

I make a temp folder on the website. When a user clicks on a link to "Make" a file (I build pdf's with Crystal Reports), I create a folder and name it
with the Session.SessionID value. Then I place the file in that folder and the next page displays a link to the file.

When the Session expires, I delete the folder.

Both events for creating and destroying the folders are handled in
global.asax.vb using Session_Start and Session_End

This sounds like more work than something simple that would stream the data, but I haven't figured that one out yet either...

--
Jerry Boone
Analytical Technologies, Inc.
http://www.antech.biz
Secure Hosting and Development Solutions for ASP, ASP.NET, SQL Server, and
Access

"Maziar Aflatoun" <ma***@rogers.com> wrote in message
news:hI*********************@news01.bloor.is.net.c able.rogers.com...
Hi everyone,

I like to export some data from the database and allow my users to store
this file to their harddrive as a .txt file. Does anyone know how I would go about doing that? (without creating the actual physical text file on my local drive first).
Thank you
Maziar A.


Nov 18 '05 #8
I see - thanks, not sure if I can get a stream my stuff (will look into it
next time I'm there) but maybe Maziar can... :)

--
Jerry Boone
Analytical Technologies, Inc.
http://www.antech.biz
Secure Hosting and Development Solutions for ASP, ASP.NET, SQL Server, and
Access

"Kevin Spencer" <ke***@takempis.com> wrote in message
news:OE**************@TK2MSFTNGP11.phx.gbl...
The tricky part is getting a FileStream to work with. When the file is
uploaded, it is not in a stream format, but in a text format (encoded
binary). I'm not sure how you would do it offhand, but you would have to
convert it to a FileStream to output it to the Response.OutputStream.

--
HTH,
Kevin Spencer
.Net Developer
Microsoft MVP
Big things are made up
of lots of little things.

"Jerry Boone" <je***@antech.biz.killspam> wrote in message
news:Gc*******************@newssvr11.news.prodigy. com...
I hear what you are asking, but... just in case someone doesn't come up with
a good idea, I will let you know what I do.

I make a temp folder on the website. When a user clicks on a link to

"Make"
a file (I build pdf's with Crystal Reports), I create a folder and name it
with the Session.SessionID value. Then I place the file in that folder

and
the next page displays a link to the file.

When the Session expires, I delete the folder.

Both events for creating and destroying the folders are handled in
global.asax.vb using Session_Start and Session_End

This sounds like more work than something simple that would stream the

data,
but I haven't figured that one out yet either...

--
Jerry Boone
Analytical Technologies, Inc.
http://www.antech.biz
Secure Hosting and Development Solutions for ASP, ASP.NET, SQL Server, and Access

"Maziar Aflatoun" <ma***@rogers.com> wrote in message
news:hI*********************@news01.bloor.is.net.c able.rogers.com...
Hi everyone,

I like to export some data from the database and allow my users to store this file to their harddrive as a .txt file. Does anyone know how I

would go about doing that? (without creating the actual physical text file
on my local drive first).
Thank you
Maziar A.



Nov 18 '05 #9
I'm trying to get my code to do the same thing... (creating a folder on
session_start and deleting it on session_end)

My problem is I can't get it to work, the treads just time out on the
<code> Dim di As New System.IO.DirectoryInfo(Server.MapPath("images/" &
Session.SessionID & "/")) </code> line. Could you post your code so I
can see what I'm doing wrong?

Thanks,
Jason

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 18 '05 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Boniface Frederic | last post by:
Hello, I want to set some files downloadable only by members with login and password. I use session to protect my .html and .php files, but I would like to know how to protect .zip files....
3
by: JJ | last post by:
Hi, I am writing a cart in ASP selling downloadable files. The files are stored on remote locations i.e. http://www.thisfilestore.com/file1.zip And have different extensions, i.e. they are not...
9
by: Xah Lee | last post by:
is the Microsoft javascript doc downloadable? http://msdn.microsoft.com/library/default.asp?url=/library/en-us/script56/html/js56jsoriJScript.asp or, is there some other downloadable complete...
3
by: vanisathish | last post by:
Hi All, Is there a way to draw charts from SQL Server Data using ASP.?Is it possible to use the SQL Reporting Services using ASp
2
by: TJS | last post by:
is there a downloadable chm help file for asp.net ?
3
by: Hongbo | last post by:
Hi, We have a web site which needs user to login. After login, there are some files available for download on some pages. A typical link of such file is like this one:...
3
by: salad | last post by:
I was wondering what folks use to creat a demo program that can be run/displayed on the web. I am considering GoToMyMeeting from the folks at GoToMyPC. With their product, you can demonstrate...
2
by: gen_tricomi | last post by:
THE IMPORTANCE OF MAKING THE GOOGLE INDEX DOWNLOADABLE I write here to make a request on behalf of all the programmers on earth who have been or are intending to use the Google web search API...
4
by: pbd22 | last post by:
Hi. I am playing with the idea of creating a embedded movie player for my site. The player must not be a downloadable software, but something that can stream videos. I know that there are a lot...
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: 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: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.