Default Files in Widget Dialog

  • This is for the version 3.x of the widget. If you're looking for the widget v2 docs, check here
  • Here’s how you migrate from v2 to v3.

Uploadcare Widget allows you to make specified files appear in the widget dialog on open. This article explains how to implement the behavior.

Specifying files that appear on widget dialog open is implemented by adding the value attribute to your widget <input> element. The attribute may either be empty or hold a file CDN URL or UUID.

If you set the value externally and trigger the DOM change event, it affects the widget. For instance, setting it to a file UUID or a CDN URL will result in that file loaded into the widget. You can do this for a live widget or even before it loads.

Here’s how you do it,

<input type="hidden" role="uploadcare-uploader" name="my_file"
  Also valid:

You may also want to check out a live example,