Problem with <img> and an Http Handler that returns an image

Discussion in 'ASP .Net' started by Alfonso Moreno, Oct 23, 2007.

  1. Hello,

    - I have defined in web.config the http handler like this:

    <handlers>
    <add verb="*" path="ImageThumbnailer.ashx"
    type="Thumbnailer.Handler.Thumbnailer, Thumbnailer.Handler"/>
    ....

    - My http handler looks like:
    namespace Thumbnailer.Handler
    {
    public class Thumbnailer : BaseHttpHandler
    .....


    - I create dynamically with javascript, an image like this and the .src
    property is defined also:

    var img = document.createElement("img");
    img.src = "ashx/ImageThumbnailer.ashx?img=../Images/Image01.jpg&size=72";
    or
    img.src = "ImageThumbnailer.ashx?img=../Images/Image01.jpg&size=72";

    but the property is stored on the database like :

    http://localhost:49573/SubdirCurren...nailer.ashx?img=../Images/Image01.jpg&size=72

    That is to say, the full path is prepended to the path of the current page.

    Does anyone have any clue as what it is happening ?

    Regards
    Alfonso Moreno
    Alfonso Moreno, Oct 23, 2007
    #1
    1. Advertising

  2. > but the property is stored on the database like :


    Sorry, this must be read...

    but the property img.src is stored as this:

    http://localhost:49573/SubdirCurren...nailer.ashx?img=../Images/Image01.jpg&size=72 That is to say, the full path of the current page is prepended.This happens in IE4+.RegardsAlfonso Moreno"Alfonso Moreno" <> wrote in messagenews:...> Hello,>> - I have defined in web.config the http handler like this:>> <handlers>> <add verb="*" path="ImageThumbnailer.ashx"type="Thumbnailer.Handler.Thumbnailer, Thumbnailer.Handler"/>> ...>> - My http handler looks like:> namespace Thumbnailer.Handler> {> public class Thumbnailer : BaseHttpHandler> ....>>> - I create dynamically with javascript, an image like this and the .srcproperty is defined also:>> var img = document.createElement("img");> img.src = "ashx/ImageThumbnailer.ashx?img=../Images/Image01.jpg&size=72";> or> img.src = "ImageThumbnailer.ashx?img=../Images/Image01.jpg&size=72";>> but the property is stored on the database like :>>http://localhost:49573/SubdirCurrentPage/ashx/ImageThumbnailer.ashx?img=../Images/Image01.jpg&size=72>> That is to say, the full path is prepended to the path of the currentpage.>> Does anyone have any clue as what it is happening ?>> Regards> Alfonso Moreno>
    Alfonso Moreno, Oct 23, 2007
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. news.austin.rr.com

    how to download img from html img tag

    news.austin.rr.com, Apr 27, 2005, in forum: ASP .Net
    Replies:
    2
    Views:
    504
    Steve C. Orr [MVP, MCSD]
    Apr 27, 2005
  2. Philipp Lenssen

    Problem: <img></img>

    Philipp Lenssen, Jun 27, 2005, in forum: XML
    Replies:
    15
    Views:
    747
    David Håsäther
    Jul 3, 2005
  3. computer_guy
    Replies:
    3
    Views:
    756
    computer_guy
    Jul 20, 2007
  4. Jopek
    Replies:
    7
    Views:
    391
    dorayme
    Apr 26, 2009
  5. Replies:
    7
    Views:
    172
    Tad McClellan
    Jun 22, 2006
Loading...

Share This Page