Read Image from DB and prompt for download in IE

J

Jeff

I have been able to store and retreive images and files as an image
data-type into SQL Server. In code, C#, there is the option to display the
image to the browser or store the file to a location on the local drive. Is
it possible to use an herf to sumbit the dynamic creation of the file
directly from the database and present a File Download dialog box with the
usual Open, Save, Cancel buttons?

Jeff
 
W

Walter Wang [MSFT]

Hi Jeff,

Thank you for your post.

Based on my understanding, your question is how to let user download the
image or file stored in SQL Server when clicking on a hyperlink in WebForm.
If I've misunderstood anything, please feel free to post here.

I think you can achieve this by using a LinkButton and handle it's click
event, read from database, and use Response.BinaryWrite to write the data
to client. You can refer to following KB article for detailed steps:

#HOW TO: Read and Write BLOB Data by Using ADO.NET Through ASP.NET
http://support.microsoft.com/kb/326502

Hope this helps. Please feel free to post here if anything is unclear.

Regards,
Walter Wang ([email protected], remove 'online.')
Microsoft Online Community Support

==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================

This posting is provided "AS IS" with no warranties, and confers no rights.
 
W

Walter Wang [MSFT]

Hi Jeff,

Appreciate your update and response. I am glad to hear that the problem has
been fixed. If you have any other questions or concerns, please do not
hesitate to contact us. It is always our pleasure to be of assistance.

Have a nice day!

Regards,
Walter Wang ([email protected], remove 'online.')
Microsoft Online Community Support

==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================

This posting is provided "AS IS" with no warranties, and confers no rights.
 
G

Guest

Hi walter!
I found this posting useful for 1.1, and 1.0. how about 2.0 do you have
reference for asp.net 2.0?
thanks
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,482
Members
44,901
Latest member
Noble71S45

Latest Threads

Top