@uppy/url import multiple images from URL

Hello everyone, there is an example besides the doc, I’m a little bit confused to use the import URL component from Uppy, also if somebody can clarify if I can create a link with an array of images like [“[http://image.com”, “[http://image2.com”] to upload at once multiple images at once?

Thanks very much!

Hi. I understand you want to programmatically add multiple URLs to the Uppy URL plugin.

I think this can be done by calling the addFile method multople times:

const url = uppy.getPlugin('Url')
await url.addFile('https://example.com/myfile1.pdf')
await url.addFile('https://example.com/myfile2.pdf')
await uppy.upload()

See Import From URL — Uppy

Almost that, is something like a URL with 10 images there ( Array of images ), I can get the images with the uppy/url? :3
thanks very much!

Not sure what you mean, but if you want an array of images, just use a JS forEach like this:

const plugin = uppy.getPlugin('Url')
for (const url of ['http://url1', 'http://url2']) {
  await plugin.addFile(url)
await uppy.upload()