Home Forums Scripts S3 File Uploader How to save files to folder inside of bucket?

This topic is: resolved
Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #26277
    localtechguy
    Post count: 4

    I am trying to save the uploaded files into a folder inside of my s3 busket, but nothing i tried is working.

    I am able to upload just fine directly into the bucket, but im lost on what i need to do to save the file into its own folder inside the bucket.

    please help?

    #26278
    localtechguy
    Post count: 4

    figured it out. S3 doesnt use folders. the folders you see are actually just filenames.

    in any case, if you want to save files into a folder inside of a bucket, then simply add the folder before the filename.

    line 210 on index.php
    change :
    return makeid() + ‘-‘ + filename;

    to :
    return ‘FOLDER_NAME/’makeid() + ‘-‘ + filename;

    I also got rid of the makeid() function so my original filenames dont get changed.
    not sure why this was implemented in the first place, i assume so every file upload is unique?

    here is my code without the random characters before each filename
    return ‘FOLDER_NAME/’+ filename;

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.