AWS s3 file downloads are not working in Chrome (Works fine with IE, Mozilla, Safari) - pdf

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

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.

Related

Does AWS S3 cache mp3 files to local?

When I click the mp3 file's AWS S3 path, it plays in my browser, see screenshot below:
Is the mp3 downloaded/cached to my local machine? If so where is it? I tried to search for it in Chrome cache folder but did not find anything. Very curious how this works exactly.
No, S3 doesn't cache any files locally. If a file were cached it's determined by your browser, who makes the decision based on a number of factors (such as HTTP headers, see [1]).
The reason the MP3 file plays in your browser is because your browser knows it can play the MP3 file and not just download it.
[1] https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control

Kaggle API Token Not Downloading

I am unable to download "Kaggle.JSON" to use the Kaggle API. I have not come across anyone else online with this problem. I have tried on Chrome, Firefox, Opera and Safari browsers and on Windows as well as Mac OS. Every time I click on "Create new API token," no downloads are triggered. Is there an alternate way to get this file? I receive the "Ensure kaggle.json is in the location ~/.kaggle/kaggle.json to use the API." message but nothing is downloaded. I do not receive a prompt to save as and the file is not saved in any location. Is there any advice as to why this is not working?
Kaggle API option in Account
Disable the pop-up blocker. Or try another browser

AWS download files from S3 in web browser

I am a newbie to AWS and one of the tasks I have is to figure out how to download MSIs, ISOs stored in S3 through a web browser. I read that I could use CLI behind the scenes. So if a customer clicks on one download; the app would make a request to S3 using one of the commands and that would download the file lets say through Google Chrome or IE (Please correct me if I'm wrong in the usage of CLI).
Now if the download stops for some reason due to internet failure; is there a way to resume the download? How do I get a download done through a client.
Thanks in advance for helping. Unfortunately the AWS links gave me very little information so seeking help here!
May
Files stored in Amazon S3 can be directly accessed via web browser, just like clicking a link on any website.
If the files are marked as publicly-accessible, anyone with the link can download the file.
If you wish to limit access to the files, your application can generate a pre-signed URL that will work for a limited time period that you specify (eg 5 minutes). Users can use/click that link to download the file within that time period.
You can also download files using the AWS Command-Line Interface (CLI), which has Copy and Sync commands. This would, however, require installation of the CLI on the user's computer. This is great if they are regularly download files or if you wish to automate the download (eg every hour or daily).
If you wish to explore AWS, sign-up for an account and make use of the Free Usage Tier, which lets you try some services for no charge.

click pdf link in web, how to preview instead of download?

I have my resume linked in my home page.
But I found when I host the pdf file on two different storage server, the default behavior when click on the link differs: one directly download the pdf file bug the other preview in a new tab.
the two links are as below:
http://data-10045577.file.myqcloud.com/doc/Zhao.Kai_ShanghaiUniv.pdf
http://7xocv2.dl1.z0.glb.clouddn.com/doc/Zhao.Kai_ShanghaiUniv.pdf
I have tested on firefox chrome IE that this is not a browser issue.
For some price issue I have to switch to the storage server of which the default behavior is downloading pdf file.
what settings should I have so that click the pdf link then preview instead of downlod?
Additionally, the storage server provide a configure option that can set the "http header", I know little about the web, so can setting a header work, if so, how to ?
I googled it and it seems the content-disposition argument in http header account for this. But I add content-disposition='inline', doesn't help.
if not the browser's issue, then the download one is added programmatically with headers, and the preview one is just putting your file in that folder on the server

Rails, paperclip and s3, prompt download or view images?

So i got successfully working Paperclip and S3 uploading in RoR 3, but it turns out that some images are prompted to download and others can be viewed in the browser. What determines this behaviour?
Part of this could be browser-specific behavior based upon the MIME file type that the server is sending your browser. .png files are most often the culprit for forced download. See this SO question about the issues between IE uploads, old MIME types, etc.
If it is inconsistent on the type of picture, there is a way you can force a file to be downloaded, but no good way to force an image to be viewed in the browser.
Edit: I know that the forced download isn't rails specific, so here is the rails-specific version
Is one of the following helps you?
Paperclip Force Download
Rails 'link_to' to Download An Image Immediately Instead of Opening it in the Browser
Both of them says to send the file to the browser as attachment.