Code Monkey home page Code Monkey logo

Comments (6)

t14 avatar t14 commented on July 4, 2024 2

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",

from amazon-s3-php-class.

StratusBase avatar StratusBase commented on July 4, 2024

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",

from amazon-s3-php-class.

joeelizondo avatar joeelizondo commented on July 4, 2024

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??

from amazon-s3-php-class.

 avatar commented on July 4, 2024

@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.

from amazon-s3-php-class.

alexstine avatar alexstine commented on July 4, 2024

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.

from amazon-s3-php-class.

martindrapeau avatar martindrapeau commented on July 4, 2024

Careful when you specify the folder + filename. There must not be a leading slash. @t14 has the correct solution.

from amazon-s3-php-class.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.