swebsy_upload_asset
Upload a local image, font, video, audio, or PDF to a Swebsy site, returning an assetId, src, and usage snippet. The only way to add your own imagery to image, video, or audio components.
Instructions
Upload a local image, font, video, audio or PDF file into the open site and return its assetId, src and a usage snippet. Images go in the asset library for image components, video for video components (attributes.src), audio for audio, PDFs as a link href; fonts are stored for update_settings fonts.custom. This is the ONLY way to get your own imagery (screenshots, logos, textures, mockups) into a site — an image with an empty src gets a random stock photo instead. Reads the file from the agent's own filesystem, so pass a path you can see (for example a screenshot you just captured). The asset is stored in the project and travels with static export and project JSON.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | Yes | Absolute path to the file on the agent's machine. Images: .png, .jpg, .jpeg, .webp, .gif, .avif, .svg. Fonts (for `update_settings` fonts.custom, pass the returned assetId): .woff2, .woff, .ttf, .otf. Video: .mp4, .m4v, .webm, .mov, .ogv. Audio: .mp3, .m4a, .wav, .ogg. Documents: .pdf. Max 10 MB (the hosting per-file cap) — re-encode larger files first (for video: H.264 .mp4, 1080p or less, `-movflags +faststart`). Prefer .svg for logos and other flat vector art so it stays crisp at any size; uploaded SVG is sanitized (scripts and external references are stripped). | |
| filename | No | Optional display name in the asset library. Defaults to the file's own basename. |