23. Februar 2010
Amazon S3 is a great way to store files that need to be exposed on the web. Every uploaded file can be accessible to the public or accessible to authorized users only via a clever system of expiring signatures.
Joe Danziger wrote an excellent CFC to do all kinds of operations via the S3 REST interface.
The only missing part is the new way Amazon is offering to upload files without the need to first buffer them on your own server.
The old way:
- You send a user (let's say a user of your CMS) to a page where he can upload a file
- The user clicks on 'Browse' to find the file on his harddisk and submits the form.
- The file is sent to your server.
- You send the file to S3 via a REST put.
- On success: you save a record in your database so you can remember what you sent to S3
The better way:
- You send a user to a page where he can upload a file
- The user clicks on 'Browse' to find the file on his harddisk and submits the form.
- The file is sent directly to a certain bucket of your Amazon S3 storage
- Amazon tells you about a successful upload and you update your database.