Hi
is there any way to change uppy options onflight in already instantiated uppy object?
I mean something like this:
const uppy = Uppy({
allowMultipleUploads: false,
restrictions: {
maxFileSize: 1000,
maxNumberOfFiles: 1,
minNumberOfFiles: 1,
allowedFileTypes: ["image/*"]
},
autoProceed: false
});
// change restrictions
uppy.setConfigs({ restrictions: { maxNumberOfFiles: null } });
Hi! It is currently not possible, but the possibility of that feature is being discussed: https://github.com/transloadit/uppy/issues/1193#issuecomment-498776981
ok, just for now, is it safe to have a couple of uppy instances with different configuration?
Yes, I know that some users actually do that, and we do test with multiple instances on the same page. Please see uppy.id option, it should be unique for each instance!
thanks
What is the best way to completely destroy the uppy instance and create a new one with different options? My idea would be to destroy the original instance after closing the modal and then create another one with a lower maxNumberOfFiles.
@IvoMiranda Try https://uppy.io/docs/uppy/#uppy-close, it should destroy the instance.
uppy.setOptions() API has been released in the latest @uppy/[email protected]!
Most helpful comment
uppy.setOptions()API has been released in the latest@uppy/[email protected]!