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

Read Image from DB and prompt for download in IE

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
Jul 4 '06 #1
4 1566
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 (wa****@online.microsoft.com, 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.

Jul 4 '06 #2
Perfect - Thank you.

"Walter Wang [MSFT]" <wa****@online.microsoft.comwrote in message
news:rf**************@TK2MSFTNGXA01.phx.gbl...
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 (wa****@online.microsoft.com, 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.

Jul 4 '06 #3
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 (wa****@online.microsoft.com, 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.

Jul 5 '06 #4
Cam
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
Aug 14 '06 #5

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

Similar topics

3
by: Paul Jaeger | last post by:
I have jpeg images that are 2848 x 4256 pixels. I want to programatically convert them to images that are approximately 427 x 638 (that maintains the ratio) and save to new jpeg files. How can...
18
by: jas | last post by:
Hi, I would like to start a new process and be able to read/write from/to it. I have tried things like... import subprocess as sp p = sp.Popen("cmd.exe", stdout=sp.PIPE)...
5
by: c8prog | last post by:
I'm using dotnetframework 1.1. By the way, I don't know how to read the information of AssemblyInfo.cs file. I wish to read it. The following Example Files. File 1: AssemblyInfo.cs using...
1
by: Marina | last post by:
Hi, I have the following code to prompt the user for a download: Response.Clear() Response.ContentType = "application/octet-stream" Response.AppendHeader("Content-Disposition",...
0
by: Xavier Osa | last post by:
Hi, I have an ASP.Net web page that you can download a file. As Fergunson's problem, it prompts twice dialog boxes only if I select Open button. If I select Save button, it prompts once. I'm...
8
by: kieran | last post by:
Hi, I want to download an image from the web and save it locally. I have spent all day messing about with this and am still no where. We have a firewall so i use the below code. I know it...
0
by: aarondouglas28 | last post by:
Hey all, I'm hoping someone can help me with a problem I'm having. I have a page that has a javascript based slide show of images on it. The user can press a play button and the page will cycle...
3
by: dcruncher4 | last post by:
It is possible that we may be asked to restore a production tape, say 3 yrs later. We would prefer redirect restore for that. I am documenting a process to do a redirect restore. We take...
70
by: quickcur | last post by:
hi can anyone explain me to read image to memory from a url it is very easy in java but it is hard to find an complete solution in c/c++. Thanks,
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.