<!-- Generated by npm run gen:skill from ui/Upload/skill.md - do not edit. -->

# Upload

## `<upload>`

- `button` (name of a button component), `folder-button` (name of a button component), `folder`, `camera`, `overwrite`, `allow-streams`, `monitor`
- events: FileUploadStarted, FileUploadComplete
- methods: setDestination, destinationUpload, uploadStart, cancelAll, cancelUnlessMonitored, closeWhenDone

## Guidance

```xml
<button name="browse" text="Upload files..."/>
<upload name="up" button="browse" width="fill"/>
<!-- in the Loaded step -->
<operation name="callMethod" value="#v#up">
  <method name="setDestination"><param>home://Documents</param></method>
</operation>
```

- Needs a signed-in CloudBackend drive. Until setDestination runs, the button reports "No upload URL set."
- From a step, `uploadStart(filename, accept)` filters the picker (`image/*`) or takes one file under a name; `camera="true"` asks phones for the camera.
- FileUploadComplete: `{!}` is done, failed or cancelled. No reload needed: each uploaded file is added to the loaded folder listing, so a component bound to the destination shows it.
- A taken name asks Keep both/Replace/Skip; `overwrite="true"` replaces (with `hide="true"` for a quiet upload). An icon-only browse button needs `title`.
