founderlab/react-dropzone-s3-uploader

How to specify path of upload

tmf-chris opened this issue · 3 comments

I am trying to get the file uploaded into a path such as this:

/folder1/folder2/filename.jpg

I am passing in an s3Url such as this:

const s3Url = 'https://s3.us-west-1.amazonaws.com/mybucket/'; const path = 'folder1/folder2'; ... <DropzoneS3Uploader onFinish={this.handleFinishedUpload} s3Url={s3Url} maxSize={1024 * 1024 * 5} upload={{s3path: path}} />

What this is doing is adding the file but it is adding the unique id stuff (that s3 prepends to the url) to the first folder:

/iweufhwe_folder1/folder2/filename.jpg

Whereas I would like it to be:

/folder1/folder2/iweufhwe_filename.jpg

Looks like the version of react-s3-uploader being used for this project is a bit old. A recent fix:

odysseyscience/react-s3-uploader@542f152

Seems to suggest they fixed an issue when you supply your own path. Could we get an update that brings in the latest version of react-s3-uploader?

I've had this issue, upgrading the react-s3-uploader to use version 4.8.0 fixed it for me.

For those of you that need a fix urgently, you can use the repo which I;ve upgraded the version, add this to your package.json:

"react-dropzone-s3-uploader": "git+https://git@github.com:fernandobandeira/react-dropzone-s3-uploader.git",

Also, consider forking the repo to yourselves and change it back to this repo once the maintainer fixes the issue.

Yeah this package seems to be no longer maintained...