Aaron Salazar
Aaron Salazar

Reputation: 4537

IE 9 Wants to Download Image Instead of Display

I'm making a get request similar to http://localhost:5050/Resource/Fetch/38763905-7e26-4ca0-adf5-2cb803b6bf75/53 to call my controller action that takes a GUID and a resolution number. It does some magic on the server side with some images and returns to my view an image. In all browsers the image displays on the page just fine but with IE9 I'm prompted to download or save the image.

Here is my jQuery line:

$('#myImage').attr("src", Ugc.Index.ProjectSubmit.ImageFetch + "/38763905-7e26-4ca0-adf5-2cb803b6bf75/53");

Thank you for your help,

Aaron

Upvotes: 1

Views: 856

Answers (2)

rouen
rouen

Reputation: 5134

You probably need to specify content dispositon = inline header if you are sending this file by yourself by writing it to response.

See : Content-Disposition:What are the differences between "inline" and "attachment"?

Upvotes: 1

Andrey
Andrey

Reputation: 21295

On the server side, when you write the image to the Response, set content type to "image/jpg" or whatever format your image is in. If that doesn't help, can you post the piece of code that outputs the image?

Upvotes: 0

Related Questions