Hey @goto-bus-stop @arturi, back again with a question. I was trying to upgrade my code to use the AwsS3 plugin (currently, it was only using the Transloadit plugin and no UI), and got stumped on one thing.
Can I use both the AwsS3 and Transloadit plugin on the same instance? In other words, something like this -
const uppy = Uppy({ autoProceed: true })
.use(Tus10)
.use(Transloadit, transloaditParams)
.use(AwsS3)
// ... bunch of .on handlers
.run()
In this case, what happens when I do addFile? Does it use the S3 plugin or the Transloadit plugin? Or is that not recommended?
If not, my alternative solution was creating two components - <S3Uploader /> and <TransloaditUploader /> each of which would initialize a separate Uppy instance. Do you see any issues with multiple instances of Uppy running? Perhaps with the Redux store setup?
Thank you!
When both AwsS3 and Transloadit are used, by default it will try to upload both to Transloadit using Tus, and then to S3. (We should maybe warn in the console if multiple uploaders are used :thinking: )
The Transloadit plugin has an option importFromUploadURLs, which disables the Tus upload functionality in the Transloadit plugin. Instead, it will wait for any other upload plugin (eg S3) to complete and set the uploadURL property on files, and tell Transloadit to download the files from those URLs. That way you can use both S3 and Transloadit together, to send files first to S3, and have Transloadit download them from there.
Note that Transloadit has to be able to GET the files from their servers, so they should be publically readable in the S3 bucket.
Running multiple instances should be fine! The Redux store scopes each instance's state to their id option (passed in the Uppy constructor), or a randomly generated identifier, so state will not leak between instances. If you are using GoldenRetriever or persisting your Redux state, you should provide an id option manually so Uppy knows which instance should restore which state.
@goto-bus-stop This information is super helpful to know, maybe can added as a FAQ to the docs.
Is there a way when initializing with multiple plugins to specify which plugin to use? I ask since my original plan was to use a single global instance but I have different destinations based on media type.
Sorry for dropping this, we're going through old issues now, is this still a problem for you? I'm not sure what the answer is off the top of my head so if it's no longer relevant i don't have to spend time thinking about it :P
I'm experiencing the same issue. Is it possible to have multiple uploaders and specify which uploader based on file type?
For instance:
['image/*'] -> AwsS3Multipart
['text/html'] -> CustomUploader
Any update on the question of @mrsweaters? I need different destinations for video/images.
Most helpful comment
Any update on the question of @mrsweaters? I need different destinations for video/images.