Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to upload a file to amazon S3 without passing it by a server?

I'm looking for a front-end solution for uploading files to amazon s3 (that is, not passing them through my server.

The solution I have found is https://code.google.com/p/swfupload/

It might do the job, but it requier flash and this is the first sentence of the project description is:

SWFUpload has not been under active development for several years.

Here are my desired features, though none of them are nessesary

  • No plugins
  • Built with Amazon S3 in mind, handling buckets authentification etc.
  • Some way to see file upload-progress
  • Support from IE8+
like image 760
Himmators Avatar asked Oct 09 '13 15:10

Himmators


People also ask

How many ways you can upload data to S3?

There are three ways in which you can upload a file to amazon S3.

How are objects uploaded to S3 by default?

When you upload a folder, Amazon S3 uploads all of the files and subfolders from the specified folder to your bucket. It then assigns an object key name that is a combination of the uploaded file name and the folder name. For example, if you upload a folder named /images that contains two files, sample1.


1 Answers

kgu87 is correct, this article pretty much explains the entire process to upload files directly to S3 without passing them trough your own server.

You can also check out the AWS docs related to this on:

http://docs.aws.amazon.com/AmazonS3/latest/dev/UsingHTTPPOST.html

http://docs.aws.amazon.com/AmazonS3/latest/API/RESTObjectPOST.html

If you're looking for an upload tool that supports HTML5 uploads directly to S3, check out Plupload

They have a great article that explains how to set it up:

https://github.com/moxiecode/plupload/wiki/Upload-to-Amazon-S3

The documentation describes a PHP service that's used to generate a policy and signature (both are required for S3 to accept your download) but you can use any language to generate those. Also, in certain use cases, you can just generate a one-time policy with a very high expiration time and hard code it into your upload form.

like image 102
dcro Avatar answered Sep 27 '22 18:09

dcro