tags:

views:

31

answers:

1

I'm dynamically generating some charts using mod_python, in .png and .pdf formats. When a user points to /some/path/some_imagefile_name.png, I want to show the image within the browser, like in this url. I also want the image to be accessible from an HTML <img src=> tag.

So far, whenever I point my browser to a .png address from my server, the .png and .pdf are automatically downloaded instead of being viewed. How should I fix this?

I tagged this under Apache, since I figured it would be an Apache config thing. If it's not, please point me towards the right direction.

Edit: Whoops, never mind... First, the correct MIME type for .png is image/png not img/png, and second, Chrome automatically downloads all .pdfs.

+4  A: 

Sounds like your python app is adding a Content-Disposition; attachment header when it should not.

webdestroya