I want to update the endpoint of the XHRUpload plugin without reloading the uppy instance (and loose the selected files if any). My strategy is to remove the plugin and re-add it with the new endpoint.
I have tried :
this.uppy.removePlugin('XHRUpload')
this.uppy.removePlugin({ type: 'uploader', id: 'XHRUpload' })
this.uppy.removePlugin(XHRUpload)
But I either get this error
TypeError: Cannot read property 'slice' of undefined
or
Already found a plugin named 'XHRUpload'. Tried to use: 'XHRUpload'.
Code sandbox : https://codesandbox.io/s/uppy-remove-plugin-nrew1?file=/src/App.vue
doesn't provide an exemple of remove a plugin.
Any ideas ?
You can also try using uppy.getPlugin('XHRUpload').setOptions({ endpoint: 'the new url' }) for that purpose.
uppy.removePlugin() is a bit hard to use … the correct syntax is:
const instance = uppy.getPlugin('XHRUpload')
uppy.removePlugin(instance)
Most helpful comment
You can also try using
uppy.getPlugin('XHRUpload').setOptions({ endpoint: 'the new url' })for that purpose.uppy.removePlugin()is a bit hard to use … the correct syntax is: