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

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 17 '05 #1
4 1249
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 17 '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 17 '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 17 '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 17 '05 #5

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

Similar topics

4
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
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
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...
1
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...
4
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'...
9
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
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
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
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...
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...
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
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.