I have a couple of mp4 videos I have stored in Amazon S3.
When I try to access the file's links from Firefox, they are played automaticlly, but when I try to open the same links in Chrome or IE the files are downloaded and not played.
I also tried setting the content type of the files to video/mp4 with no luck.
Doe's anyone know of a solution to this issue?
Try to store your videos with file_get_contents($videos) to s3 bucket , so that the stored video in bucket can get the original file content and then it can play on any browser
Related
i have a website similar to video hosting where i need to display upload videos and images and have the images be visible and also the videos if they are purchased, however their locations are saved in the database (MongoDB) and are displayed on the web-page and therefore show up in the network tab in the developer console.
this means that if you click on the link e.g. "https://s3.Region.amazonaws.com/bucket-name/key-name/folder/file-name.mp4" it will auto download, this only happens on chrome though but not Firefox where it just displays the object with no download option. i have tried to change the bucket policy, add encryption but either that causes the images that i want to display to become invisible as they are not publicly accessible or just has no effect and still allows for the video to be downloaded. is there any way for me to have the images and videos in the same bucket and have them both be visible under the right circumstances but block access to the bucket and prevent them from being downloaded by anyone but the bucket owner?
You cannot stop the downloads because the ability to show videos and images in a browser also means that the files are accessible via URL (that's how the browser fetches them).
One option is to use an Amazon S3 pre-signed URL, which is a time-limited URL that provides temporary access to a private object. The way it would work is:
Users authenticate to your back-end service
When a user requests access to one of the videos or images, your back-end checks that they are authorized to access the file
If so, your back-end generates an Amazon S3 pre-signed URL and includes it in the web page (eg <img src='...'>)
When the user's browser accesses that URL, Amazon S3 will verify that the URL is correct and the time-limit has not expired. If it's OK, then the file is provided.
Once the time limit expires, the URL will not work
This will not prevent a file being downloaded, but it will limit the time during which it can be done.
Alternate methods would involve serving content via streaming instead of via a file, but that is a much more complex topic. (For example, think about how Netflix streams content to users rather than waiting for them to download files.)
I have a private bucket with some csv files. I want to provide these files to the end user, but I do not want the end user to be logging into my S3 bucket console to download these files.
I can have a CloudFront distribution that allows access to these files only through the that distribution when I use Origin Access Identities (OAI). To fetch the files through cloudfront the user is expected to the know the full path of the file in S3.
In my case the user does not know the full path, or the name of the files. I am trying to find a way to render the csv files on S3 and provide them in some way to the user to download without having them go to the console. Ideally they would see a very basic folder structure that they can navigate and click on to download the files.
Does this require building a full web app? What is the easiest way?
I am building a website where I am uploading wallpapers on s3 bucket and I want users to be able to download those wallpapers from my website on the click of a button.
Earlier I was using simple anchor tag and download attribute to download the image file but now if I click on he download button my image just opens in full size in new tab.
I am not sure why this is happening and how can I Fix this. I want to be able to download the image on click not open it new tab.
Is there a way to download the current site content, namely, the uploaded user images, from a web application on AWS? Everything I have found only gives access to previous code deployments, which do not include the user uploaded files.
I have tried the instructions here but it only seems to give access to the code as it was at the time of deployment.
Thank you for any help.
User uploaded images are usually stored in Amazon's S3 service, so go to your AWS dashboard and navigate to the S3 section, and you should find the files in a bucket there
Are you trying to download your own website ? Then you need to get not just code or user images; but also database containing data. You need to check the code where images are saved.. Are they on local EBS or EFS or S3 and correspondingly copy from there.
If you are trying to download some-one else website. Then surely you will not have access to database or code or other user images; but still you can download full website as seen to the public using many tools like WinHTTrack.
I am working on an application where some videos are uploaded to Amazon S3.
Now a user can choose to download the video or stream it.
The public url on amazon s3 is say "amazons3.com/test/file.mp4".
As of now, everytime I visit the url, it streams the video.
How to I append parameters to the url so that the video can be streamed or dowloaded.
Basically, original url should stream the video, and modified_url should download it.
Thank you!
I found a very easy way.
In the html file, instead of
Download
I used
Download
Reference: href image link download on click