Update endpoint for every upload


#1

I initialize Uppy on componentWillMount and configured uppy.use with an endpoint. But for the next upload I would like to change the endpoint. when I try to change again with uppy.use Im getting an error that I can’t configure more than once for XHRRequest. How can I change the upload end point for every upload


#2

Hi! There is no perfect way to do this unfortunately, but it can work. You had the right idea to .use() the XHRUpload plugin again. It’s a little inconvenient, but you need to remove the old one first:

const plugin = uppy.getPlugin('XHRUpload') // must be a string!
if (plugin) uppy.removePlugin(plugin)
uppy.use(XHRUpload, {
  // new options
})

Hope that helps!