Filename of picture retrieved from database?

Discussion in 'ASP .Net' started by grz01, Mar 24, 2005.

  1. grz01

    grz01 Guest


    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?

    grz01, Mar 24, 2005
    1. Advertisements

  2. grz01

    Patrice Guest

    Patrice, Mar 24, 2005
    1. Advertisements

  3. Steve C. Orr [MVP, MCSD], Mar 24, 2005
  4. Hi,

    Are you especifynng the correct content type?

    Ignacio Machin \( .NET/ C# MVP \), Mar 24, 2005
  5. grz01

    grz01 Guest

    Yes, that's just what I needed!
    Thanks Steve!
    grz01, Mar 25, 2005
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.