473,503 Members | 1,696 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Filename of picture retrieved from database?


Hi,

I have written a webpage, showpict.aspx,
in C# that will fetch a jpg-picture from a database
and display it thru a html-tag like:

<img src="showpict.aspx?id=23">

where the 'id' parameter tells what picture from the
db to display.

Problem is, if the user e.g. rightclicks the picture
in the web-brower, then does 'Save Picture as...'
the suggested file-extension is wrong.
IE6 will suggest the filename: untitled.bmp
while Firefox simply suggests: showpict.aspx.

Q: How can I get the browser to suggest a name ending with .jpg?
I have seen this work as desired on other sites...

Is there a http-header to do this trick or what?

Thanks,

Nov 19 '05 #1
4 1086
Try :
http://support.microsoft.com/kb/260519/en-us

--

<gr***@spray.se> a écrit dans le message de
news:11**********************@o13g2000cwo.googlegr oups.com...

Hi,

I have written a webpage, showpict.aspx,
in C# that will fetch a jpg-picture from a database
and display it thru a html-tag like:

<img src="showpict.aspx?id=23">

where the 'id' parameter tells what picture from the
db to display.

Problem is, if the user e.g. rightclicks the picture
in the web-brower, then does 'Save Picture as...'
the suggested file-extension is wrong.
IE6 will suggest the filename: untitled.bmp
while Firefox simply suggests: showpict.aspx.

Q: How can I get the browser to suggest a name ending with .jpg?
I have seen this work as desired on other sites...

Is there a http-header to do this trick or what?

Thanks,

Nov 19 '05 #2
Response.AddHeader("Content-Disposition", "inline;filename=test.jpg")

Here are more details:
http://steveorr.net/articles/EasyUploads.aspx

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

<gr***@spray.se> wrote in message
news:11**********************@o13g2000cwo.googlegr oups.com...

Hi,

I have written a webpage, showpict.aspx,
in C# that will fetch a jpg-picture from a database
and display it thru a html-tag like:

<img src="showpict.aspx?id=23">

where the 'id' parameter tells what picture from the
db to display.

Problem is, if the user e.g. rightclicks the picture
in the web-brower, then does 'Save Picture as...'
the suggested file-extension is wrong.
IE6 will suggest the filename: untitled.bmp
while Firefox simply suggests: showpict.aspx.

Q: How can I get the browser to suggest a name ending with .jpg?
I have seen this work as desired on other sites...

Is there a http-header to do this trick or what?

Thanks,

Nov 19 '05 #3
Hi,

Are you especifynng the correct content type?

cheers,

--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation
<gr***@spray.se> wrote in message
news:11**********************@o13g2000cwo.googlegr oups.com...

Hi,

I have written a webpage, showpict.aspx,
in C# that will fetch a jpg-picture from a database
and display it thru a html-tag like:

<img src="showpict.aspx?id=23">

where the 'id' parameter tells what picture from the
db to display.

Problem is, if the user e.g. rightclicks the picture
in the web-brower, then does 'Save Picture as...'
the suggested file-extension is wrong.
IE6 will suggest the filename: untitled.bmp
while Firefox simply suggests: showpict.aspx.

Q: How can I get the browser to suggest a name ending with .jpg?
I have seen this work as desired on other sites...

Is there a http-header to do this trick or what?

Thanks,

Nov 19 '05 #4
Yes, that's just what I needed!
Thanks Steve!
Response.AddHeader("Content-Di*>sposition", "inline;filename=test.jpg")
Here are more details:
http://steveorr.net/articles/E*asyUploads.aspx


Nov 19 '05 #5

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

Similar topics

4
1884
by: Michael | last post by:
All, I'll asked a question but I was not detailed (clear) enough for people to help so I'll retry. I have a cgi script pass a variable from one page to the next. The 'receiving' page replaces...
12
15833
by: Sharad Gupta | last post by:
i have this problem of capturing the filename on the instance when onclick is activated in the <body> the function should catch the filename and display it. Second problem, i have to catch the...
3
1953
by: Lumpierbritches | last post by:
I'm trying to move my images from my main folder to an image folder for the database to store pictures of animals. I borrowed code that works great if I put all the images in the main folder where...
4
1254
by: grz01 | last post by:
Hi, I have written a webpage, showpict.aspx, in C# that will fetch a jpg-picture from a database and display it thru a html-tag like: <img src="showpict.aspx?id=23"> where the 'id'...
1
5302
by: DAC | last post by:
Hello. How can I Respose.BinaryWrite a file but preserving the original filename. Explaining better: Suppose a webform that displays images stored on my database. The page shows, say, 5 pics at...
0
1242
by: Olav Tollefsen | last post by:
I have an .aspx file with the following code in Form_Load: image = System.Drawing.Image.FromFile(imageFilename); Response.ContentType = "image/jpeg"; image.Save(Response.OutputStream,...
9
9760
by: charliewest | last post by:
Hello - I have images saved in my SQL SERVER 2000 database. Using ASP.NET (C#) is there any way to temporarily save an image to a session object, and after running some other operations, later...
20
929
by: Abhishek | last post by:
can anybody tell how to fetch image from database(access) to the visual basic picture box control. the code i have been using is as below but it gives me invalid paramter error.... Dim...
3
2496
by: Anoosha | last post by:
Dear Programmers I need your help, I have a PictureBox there I load A picture retrieved from Database. This so far good, but Now I want to scan the picture line by line horizontaly, to find which...
2
2260
by: MattGaff | last post by:
I have made an imagelist and populated it with a few images where the filename of each of the files is important. I can generate the random images in a PictureBox when I click a button. The code...
0
7278
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
7328
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
7456
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...
1
5011
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...
0
4672
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3166
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
1510
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
734
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
379
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.