Widget multi upload

  • This documentation is for the version 3.2.3 of the widget. If you're looking for the widget v2 docs, check here.

Often, you want users to upload sets of files, not just single ones. This is done by adding the data-multiple attribute to your input with the specified role, role="uploadcare-uploader">. The boolean attribute should be set to true. This will let users choose and upload many files in one go,

<input type="hidden" role="uploadcare-uploader" name="my_files"
  data-multiple="true"
/>

The files are then stored as a file-group, and you get a group_id instead of the UUID in the value. Group IDs look like this:

088de3b6-c5f2-4f56-9e9c-87b0b960286e~3

Such IDs resemble UUIDs but have a number after ~. The number stands for the number of files in that group. If you are not using autostore, you can store this group in the same way as a single file via an API request.

group_id can then be used to get any single file in a group from CDN,

http://ucarecdn.com/088de3b6-c5f2-4f56-9e9c-87b0b960286e~3/nth/0/
http://ucarecdn.com/088de3b6-c5f2-4f56-9e9c-87b0b960286e~3/nth/1/
http://ucarecdn.com/088de3b6-c5f2-4f56-9e9c-87b0b960286e~3/nth/2/

All media processing operations are supported by this scheme,

http://ucarecdn.com/088de3b6-c5f2-4f56-9e9c-87b0b960286e~3/nth/0/-/scale_crop/300x300/center/

Note, when trying to access a Group ID via a browser, you will see a list of individual file UUIDs in this group.

We’re always happy to help with code, integration, and other stuff. Search our site for more info or post your question in our Community Area.