Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Downloading a file from SQL database

Status
Not open for further replies.

shaqtus123

Technical User
Sep 24, 2010
4
US
A part of my website allows users to upload files to the SQL database. This file is saved in the database in binary format, and once it is saved, I want users to be able to download this file from the database. How can I write code to dynamically create a link to the file?
 
That works, but it only displays the contents of the file in the browser. I need to be able to download the actual file. How can I do that?
 
If it displays the content of the file in your browser, that is because of your pc setup - some people may choose to have it open in an external program by default. If you want to change this behaviour you can change the content type to "application/octet-stream" and then it should prompt the open/save box by default.

Mark,

Darlington Web Design[tab]|[tab]Experts, Information, Ideas & Knowledge[tab]|[tab]ASP.NET Tips & Tricks
 
When I do that, it strangely gives me a file dialog that is letting me download the .aspx file of the actual page. What's going on here?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top