15

I'm using plupload 1.4.2 to upload files directly to an Amazon S3 bucket. The question is, how can I upload them to a subfolder directly? What parameters should I configure in the policy or plupload object config?

Philip Kirkbride
  • 21,381
  • 38
  • 125
  • 225

1 Answers1

39

Amazon S3 there is no concept of folder or subfolder. Only objects. And an object has a key.

If you wanna upload a file to a folder or subfolder, simply put the object key like this:

$key = "folder/subfolder/filename.extension";

And Amazon S3 will create the (imaginary) folder(s) and subfolder(s).

Jesús
  • 780
  • 8
  • 16
  • If you are doing the `$key` as a hidden field in a form, you can do something like `name="key" value="folder/${filename}"`. – Kevin Beal Jul 03 '13 at 19:20