Uppy: Change Uppy object configuration on flight

Created on 21 Jun 2019  路  7Comments  路  Source: transloadit/uppy

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 } });
Core Duplicate Feature

Most helpful comment

uppy.setOptions() API has been released in the latest @uppy/[email protected]!

All 7 comments

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]!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

rrjanbiah picture rrjanbiah  路  3Comments

quetzyg picture quetzyg  路  3Comments

ghost picture ghost  路  3Comments

anushkamds picture anushkamds  路  3Comments

hikurangi picture hikurangi  路  4Comments