amazon s3, upload file in folder in bucket


I am trying to upload a file to a folder inside a s3 bucket.
I am doing the following in PHP:

The bucket name is a string sent to PHP and indicates a subfolder using a forward slash:

however, when I upload a new image to my bucket, it is uploaded to the bucket root.
How can I upload this file to the subfolder in my bucket?



The name of the sub folder should be added to the beginning of the filename and not to the end of the bucket name.

Leave a Reply