GoFuckYourself.com - Adult Webmaster Forum

GoFuckYourself.com - Adult Webmaster Forum (https://gfy.com/index.php)
-   Fucking Around & Business Discussion (https://gfy.com/forumdisplay.php?f=26)
-   -   Anyone Know How to Force Download for Files on Amazon AWS S3 (https://gfy.com/showthread.php?t=1169002)

srockhard 06-24-2015 07:16 PM

Anyone Know How to Force Download for Files on Amazon AWS S3
 
For instance .mp4 files just want to stream in my browser but I want them to automatically begin downloading when accessed.

xXXtesy10 06-24-2015 10:17 PM

Quote:

Originally Posted by srockhard (Post 20507207)
For instance .mp4 files just want to stream in my browser but I want them to automatically begin downloading when accessed.

:winkwink::winkwink: i want same but force apk, pdf or exe. bump for answer :thumbsup

freecartoonporn 06-24-2015 10:36 PM

its not the server , its your browser, which has associated .mp4 files with specific program.

if you are using firefox then go to

about:preferences#applications

there you can set what you want to when a mp4 is pushed from the server.

hope this helps.

if anyone have more info , feel free to correct me.

now will you please hit the thanks button.

brandonstills 06-24-2015 11:07 PM

Is it possible to set headers on the server?

Content-Type: application/octet-stream
Content-Disposition: attachment;filename=\"blah.mp4\"

You mention S3, I'm not sure about headers but from working with it in the past I remember it being a major pain in the ass and me not wanting anything to do with it.

srockhard 06-24-2015 11:19 PM

Thank you but this is not what I'm looking for. I don't care what my own browser is doing I am more concerned with user experience on my site. I found this article but I don't really understand what they are doing ... Amazon AWS S3 to Force Download Mp3 File instead of Stream It - Stack Overflow

Quote:

Originally Posted by freecartoonporn (Post 20507252)
its not the server , its your browser, which has associated .mp4 files with specific program.

if you are using firefox then go to

about:preferences#applications

there you can set what you want to when a mp4 is pushed from the server.

hope this helps.

if anyone have more info , feel free to correct me.

now will you please hit the thanks button.


brandonstills 06-24-2015 11:24 PM

Quote:

Originally Posted by srockhard (Post 20507264)
Thank you but this is not what I'm looking for. I don't care what my own browser is doing I am more concerned with user experience on my site. I found this article but I don't really understand what they are doing ... Amazon AWS S3 to Force Download Mp3 File instead of Stream It - Stack Overflow

When you download a file, the server sends what are called "response headers". These instruct the browser how to treat the data. Normally it is a setting you can configure in your Apache or nginx config. From that stackoverflow link it looks like you can indeed set it in S3. I imagine it is set on the metadata for that "object" and maybe can be set for the entire "bucket".

Tom.K 06-24-2015 11:53 PM

you can edit http headers for files in your S3 browser, set content type to application/octet-stream (you should click apply changes too after you save changes and reload to be sure changes are done)

after that, when you copy/paste link in your browser, it should give you open/save dialogue in browser

freecartoonporn 06-25-2015 12:14 AM

Quote:

Originally Posted by srockhard (Post 20507264)
Thank you but this is not what I'm looking for. I don't care what my own browser is doing I am more concerned with user experience on my site. I found this article but I don't really understand what they are doing ... Amazon AWS S3 to Force Download Mp3 File instead of Stream It - Stack Overflow

i almost f orgot content disposition ,

you need to set the header.

depends on how are you pushing the file to users. if you are using php to download the file then you need to set these headers in php where you are allowing to download file

Content-disposition: attachment; filename=song.mp3

but if you are using web server then you need to add the\is header to web server either via rule matching or extension matching or location matching something like that , i have recently implemented something similar with nginx.,


hope this helps.

google "content disposition amazon s3"
maybe try this .,

php - How to set Content-Disposition Headers as a default on Amazon S3 Bucket - Stack Overflow

HomerSimpson 06-25-2015 04:05 AM

1. Simple HTML 5 solution

Code:

<a href="path_to_mp4_file.mp4" download="filename.mp4">Click here to download</a>
This will force the download just as the user has right clicked and clicked save.


2. Much better, but bit complicated solution is to setup metadata on the object

Code:

Content-Type: "application/octet-stream"
Content-Disposition: "attachment"

You can do this trough S3 console...

srockhard 06-25-2015 10:02 PM

Ok. So who is the guru here that I can pay to make this happen for me?


All times are GMT -7. The time now is 07:14 PM.

Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
©2000-, AI Media Network Inc