473,406 Members | 2,620 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,406 software developers and data experts.

How do I download filefrom database

Hi All
I have a database field of type Image.
I uplaod the file by using simpl asp.net
now I want to download that file directly to to the client side. with
download it on the server side.
I also saved the FileName, ContentType and FileExtenion in the database.

How do I do that . Please help.

I search it on google, and other sites but all have similar examples that
the file download from a web directory.
I do not want to use it.

Regards
Ather Ali
Nov 18 '05 #1
1 1012
Create a new web form and delete all the HTML (except the top yellow line)
In your code behind set the Response.ContentType to the appropriate string
for your file type.
(If you're not sure you can look it up here:
http://www.utoronto.ca/webdocs/HTMLd.../mimetype.html)

Now output your data using Response.Write if it's a text file, or
Response.OutputStream.Write if it's binary.

You might also want to set the filename so an Open/Save dialog will appear
to the user consistently.
You can do that with a line of code such as this:
Response.AddHeader("Content-Disposition","attachment;filename=" +
myDataReader["File_Name"].ToString());

Here's an example with complete source code:
http://www.aspnetpro.com/features/20...200307so_f.asp

--
I hope this helps,
Steve C. Orr, MCSD, MVP
http://Steve.Orr.net

"Ather Ali Shaikh" <at*******@eintelligencesoft.com> wrote in message
news:eO**************@tk2msftngp13.phx.gbl...
Hi All
I have a database field of type Image.
I uplaod the file by using simpl asp.net
now I want to download that file directly to to the client side. with
download it on the server side.
I also saved the FileName, ContentType and FileExtenion in the database.

How do I do that . Please help.

I search it on google, and other sites but all have similar examples that
the file download from a web directory.
I do not want to use it.

Regards
Ather Ali

Nov 18 '05 #2

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

Similar topics

3
by: Dux | last post by:
I have used some example code to create a database in MySQL and using php I can add binary files to the database. I was under the impression that I would be able to download the files with the...
11
by: Jim Willsher | last post by:
Hi all, PHP 4.2.2 on RedHat9 I have some files on my website for people to download, and I want to generate the file location "on the fly", so the URL is held in a database. I have a simple...
6
by: Samir | last post by:
Hello, I have a website that is hosted by another company. Is there some kind of php script to limit downloading to a certain amount size? And is there kind thing I can do to the .htaccess...
8
by: IGC | last post by:
I have a requirement to record in a database when a file is finished downloading to the end-user. Currently when a user clicks a download icon for a file it directs to an ASP page that records the...
1
by: com | last post by:
Extreme Web Reports 2005 - Soft30.com The wizard scans the specified MS Access database and records information such as report names, parameters and subqueries. ......
1
by: Ather Ali Shaikh | last post by:
Hi All I have a database field of type Image. I uplaod the file by using simpl asp.net now I want to download that file directly to to the client side. with download it on the server side. I...
6
by: Mark Sandfox | last post by:
I have a need to allow an extrenal IT department to download 1 specific database. I have treid direct link and webclient methods but both get permission errors. This type of page is not served....
2
by: =?Utf-8?B?SHVzYW0=?= | last post by:
Hi EveryBody: I'm working with project in my company by using ASP.Net 2.0 that allow the users to upload and download files to web site in the internet as backup. The user will first upload his...
0
by: =?Utf-8?B?SHVzYW0=?= | last post by:
Hi EveryBody: I'm working with project in my company by using ASP.Net 2.0 that allow the users to upload and download files to web site in the internet as backup. The user will first upload his...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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
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...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.