473,379 Members | 1,386 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,379 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 22 '05 #1
4 837
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 22 '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 22 '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 22 '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 22 '05 #5

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

Similar topics

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...
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...
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'...
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'...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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.