Go Back   Velocity Reviews > Newsgroups > ASP Net
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

Reply

ASP Net - Filename of picture retrieved from database?

 
Thread Tools Search this Thread
Old 03-24-2005, 06:17 PM   #1
Default 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,



grz01@spray.se
  Reply With Quote
Old 03-24-2005, 06:25 PM   #2
Patrice
 
Posts: n/a
Default Re: Filename of picture retrieved from database?
Try :
http://support.microsoft.com/kb/260519/en-us

--

<> a écrit dans le message de
news: 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,
>





Patrice
  Reply With Quote
Old 03-24-2005, 06:33 PM   #3
Steve C. Orr [MVP, MCSD]
 
Posts: n/a
Default Re: Filename of picture retrieved from database?
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



<> wrote in message
news: 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,
>





Steve C. Orr [MVP, MCSD]
  Reply With Quote
Old 03-24-2005, 06:51 PM   #4
Ignacio Machin \( .NET/ C# MVP \)
 
Posts: n/a
Default Re: Filename of picture retrieved from database?
Hi,

Are you especifynng the correct content type?

cheers,

--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation


<> wrote in message
news: 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,
>





Ignacio Machin \( .NET/ C# MVP \)
  Reply With Quote
Old 03-25-2005, 01:19 AM   #5
grz01@spray.se
 
Posts: n/a
Default Re: Filename of picture retrieved from database?
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




grz01@spray.se
  Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
anamorphic enhancement on anchor bay dvd's jamestk9888@webtv.net DVD Video 46 10-10-2006 10:49 PM
New DVD database website dvdloc8.com DVD Video 2 10-19-2004 06:59 AM
Philips DVDR75 picture quality problems Tony Jeffreys DVD Video 1 10-18-2004 04:21 PM
Am I missing the point BRS DVD Video 179 01-11-2004 07:31 PM
black&white picture on TV Edi Rimanic DVD Video 0 01-05-2004 02:24 PM




SEO by vBSEO 3.3.2 ©2009, Crawlability, Inc.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46