I have a url similar to /abc/1.png i then rewrite it to /full/path/1.png. However it seems like the mime is being clobbered because when hitting view image with firefox i get a download instead of a page with the image. How do i solve this? I am using C# and ASP.NET you can view this post for more details http://stackoverflow.com/questions/1025013/why-are-image-acting-as-downloads/1025035
+1
A:
I suspect that the MIME type of your friendly name is not correct? Can you show an example of the code you are using to render your friendly name version of the image?
Updated:
If your site is trying to serve images directly from asp.net code you need to set the response headers with the mime type of the image you're trying to return...
John Weldon
2009-06-22 00:43:05
It was in that link http://stackoverflow.com/questions/1025013/why-are-image-acting-as-downloads/1025035 pre rewrite its .../xyz.png, postrewrite is .../number.png
acidzombie24
2009-06-22 00:59:03
so... xyz.png is being handled as an asp.net page? the code in the link shows the current request being re-written, which indicates to me that the current request is being handled by asp.net rather than just as an image? What is the url in the browser, and what asp code is rewriting the request?
John Weldon
2009-06-22 01:42:05
That makes some sense, that its being caught but ASP and being treated as an ASP page. Do you know how to do what i am trying to do post or send me an email and i'll send a piece of code. Essentially i generate a file image /a/sub/id/title.ext and map it to /path/id.ext (png, jpg, etc). The thing bothering me the most is that it finds/displays the image perfectly but doesnt send the correct mime (i actually dont know if mime is the problem).
acidzombie24
2009-06-22 01:56:50
[email protected] ... I can't promise getting back to you tonight but I can probably send a reply tomorrow some time...
John Weldon
2009-06-22 02:29:53
I'll need a day or two to make improvements and cleanup my code before i send that email.
acidzombie24
2009-06-22 05:09:34