12

I am using s3 to store my pdf files. But when i tries to download the files from s3 using chrome browser it doesn't do anything. It just refresh the page, no error, nothing ... But from other browsers i can download that file. When i checked in the console it gives 'Resource interpreted as Other but transferred with MIME type undefined.'

I got one thread from AWS https://forums.aws.amazon.com/thread.jspa?threadID=79493

But we can not tell user that go & disable this plugin & then download.

Is it a problem from AWS end?

I searched a lot but didn't get any solution. Please help me to resolve this issue.

Thanks, Vijay

Vijay Kumbhar
  • 896
  • 1
  • 13
  • 31

1 Answers1

13

I had this problem too. The solution it to force Chrome to download the PDF file instead of trying to open it in its reader.

In your GET request, append response-content-disposition=attachment. Refer to the S3 documentation on how to do this.

More details available here.

James Lim
  • 12,915
  • 4
  • 40
  • 65
  • Updated link to use Wayback Machine. – James Lim Jun 26 '13 at 15:31
  • on carrier_wave it will be something like this: acticle.file.url({:query => {"response-content-disposition" => "attachment"}}). https://github.com/carrierwaveuploader/carrierwave/pull/566 – ajahongir Dec 10 '13 at 22:35
  • If the purpose is to display the PDF in the browser (e.g. inline display), this isn't really a solution at all. I guess I'll look into using my backend as an intermediary if the AWS links with parameters are the problems – Patrick Fowler Apr 11 '15 at 23:56