amazon-s3-php-class
amazon-s3-php-class copied to clipboard
Bucket folder support?
I can't see that this library supports bucket folders, is that true? Could I persuade someone to issue a pull request adding this functionality?
Great work on this library. I know AWS has their on sdk, but this is small and simple. thanks.
To upload into a bucket folder just add the folder name where you provide the bucket info.
For example :
S3::putObject( S3::inputFile("foo.jpg", false), "yourBucket/folderName", "foo.jpg",
Is there a similar way to get
from a bucket folder? It doesn't seem scalable to have to download the contents of the entire bucket and then filter through that list just to get the files that I want. Looking through the code it looks like the S3Request class has a $uri parameter that might have been intended to help with this??
@StratusBase If you get an error message about needing to use the specified endpoint..
If your bucket is not in the US Standard region, you cannot use the path-style syntax for folders. There's a brief conversation in http://www.sitefinity.com/developer-network/forums/set-up-installation/amazon-s3---must-be-addressed-using-the-specified-endpoint about this.
If you need your bucket to NOT be in the US Standard region, there may be another approach but I haven't looked into that.
Placing the the directory path as part of the file name worked me. So Based on Stratusbase's example above. The third param should contain the folder and the file name.
S3::putObject( S3::inputFile("foo.jpg", false), "yourBucket", "folderName/foo.jpg",
Any fix for this yet? Would like to fetch a folder from us-east-2. The solution is to change to "bucket.s3.us-east-2.amazonaws.com" then the path method should work. I'm just not sure at this time how to do it. I managed to almost have it working but could not eliminate a single "." at the end of the URL.
Any help is greatly appreciated.
Careful when you specify the folder + filename. There must not be a leading slash. @t14 has the correct solution.