phpfile-uploaduploadamazon-s3transloadit

Path image + file upload to amazon s3 with transloadit


I want to upload images/videos/... to my amazon s3 bucket. I am using Transloadit to upload my files. The upload works but my images are stored like this:

images/ef/c3f8aa22f70265d8c12c799df0bbed/image.jpg

I just want to have the "image.jpg" in my /images folder. My Transloadit code:

$('form#MyForm').transloadit({
        wait: true,
        triggerUploadOnFileSelection: true,
        params: {
            auth: { key: "myapikey" },
            steps: {
                resize_to_125: {
                    robot: "/image/resize",
                    use: ":original",
                    width: 750,
                    height: 750
                },
                store: {
                    robot: "/s3/store",
                    key: "myket",
                    secret: "mysecretkey",
                    bucket: "mybucket/images",
                }
            }
        }
    });

Anybody knows how I can do this?


Solution

  • add path in store segment:

     steps: {
                resize_to_125: {
                    robot: "/image/resize",
                    use: ":original",
                    width: 750,
                    height: 750
                },
    
     store: {
                    robot: "/s3/store",
                    key: "myket",
                    secret: "mysecretkey",
                    bucket: "mybucket",
                    path: "images/image.jpg",
                }