Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. Query string problem for images [modified]

Query string problem for images [modified]

Scheduled Pinned Locked Moved ASP.NET
databasecsharphtmlasp-nethelp
3 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • D Offline
    D Offline
    Davide Icardi
    wrote on last edited by
    #1

    I have a ASP.NET website that use an HTTP handler (.ashx) to load some images from a database. Like this: ![](Attach.ashx?article=homepage&attach=EucalyptoLogoSmall.png&mode=show) I have created an ASP.NET log to report all the errors and I have noticed that sometime I receive from the internet wrong requests. Basically the request converts the '&' character to '& amp ;' (like an html encoded string). Like this: Attach.ashx?article=homepage& amp ;attach=EucalyptoLogoSmall.png& amp ;mode=show (I have used the spaces inside the '& amp ;' otherwise this forum convert it to &) Do you have an idea on how to solve this problem? Thanks Davide -- modified at 11:26 Friday 20th April, 2007

    G 1 Reply Last reply
    0
    • D Davide Icardi

      I have a ASP.NET website that use an HTTP handler (.ashx) to load some images from a database. Like this: ![](Attach.ashx?article=homepage&attach=EucalyptoLogoSmall.png&mode=show) I have created an ASP.NET log to report all the errors and I have noticed that sometime I receive from the internet wrong requests. Basically the request converts the '&' character to '& amp ;' (like an html encoded string). Like this: Attach.ashx?article=homepage& amp ;attach=EucalyptoLogoSmall.png& amp ;mode=show (I have used the spaces inside the '& amp ;' otherwise this forum convert it to &) Do you have an idea on how to solve this problem? Thanks Davide -- modified at 11:26 Friday 20th April, 2007

      G Offline
      G Offline
      Guffa
      wrote on last edited by
      #2

      Perhaps some browser is correcting the url in an unexpected way. To write the url correctly in the html code, you should use & in the url: ![](Attach.ashx?article=homepage&attach=EucalyptoLogoSmall.png&mode=show) Try if correcting the code makes the problem go away.

      --- single minded; short sighted; long gone;

      D 1 Reply Last reply
      0
      • G Guffa

        Perhaps some browser is correcting the url in an unexpected way. To write the url correctly in the html code, you should use & in the url: ![](Attach.ashx?article=homepage&attach=EucalyptoLogoSmall.png&mode=show) Try if correcting the code makes the problem go away.

        --- single minded; short sighted; long gone;

        D Offline
        D Offline
        Davide Icardi
        wrote on last edited by
        #3

        Thanks for your response. You are right I have written a wrong example. Actually I use exactly your syntax. (sorry for the copy and paste bug but I think that the forum has replaced the characters ...). If you want you can see the real page at www.devage.com . As you can see the image at the center of the page use the right syntax but I still receive the wrong request from internet. It is possible that the request came from a search spider or something similar? Here a line of the log that cause the error: 2007-04-19 09:26:49 W3SVC946387459 80.67.115.122 GET /Wiki/Attach.ashx article=homepage&attach=EucalyptoLogoSmall.png&mode=show 80 - XXX.XXX.XXX.XXX Mozilla/4.0+(compatible;+MSIE+6.0;+Windows+NT+5.1;+SV1;+.NET+CLR+1.1.4322;+.NET+CLR+2.0.50727) www.devage.com 200 0 0 (I hope that the forum display it correctly) Seems to be a XP with IE 6 but it is not always the same. Ideas? Thanks in advance Davide

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups