SVG and documents
Besides photos, the library holds SVG graphics (logos, icons, illustrations) and documents (PDF, Word, Excel, PowerPoint, text, CSV, ZIP). SVGs are displayed like images; documents are offered to visitors as downloads or, for PDFs, opened in the browser.
SVG and documents
Besides photos, the library holds SVG graphics (logos, icons, illustrations) and documents (PDF, Word, Excel, PowerPoint, text, CSV, ZIP). SVGs are displayed like images; documents are offered to visitors as downloads or, for PDFs, opened in the browser.
When to use
- SVG: logos and icons that must stay crisp at any size, simple illustrations.
- PDF: brochures, price lists, terms and conditions, forms to print.
- Office and other documents: templates and files visitors download.
SVG files
- Upload the
.svgin Assets. Its width and height are read from the file'sviewBoxwhen present. - Use it anywhere an image is accepted: the Image component (Source = Uploaded asset), the Theme logo and favicon, page SEO images.
- SVGs are not converted to WebP and cannot be opened in the image editor (crop, rotate and resize are for raster images only).
For safety, every uploaded SVG is cleaned: scripts, embedded HTML (foreignObject), event handlers such as onclick, javascript: links and entity declarations are removed, and the file is served in a sandboxed way so it can never run code in your app. Purely visual SVGs are unaffected; an SVG that relied on scripts for animation will appear static.
PDF files
- In the library, PDFs show an inline preview in the details panel.
- In the app, PDFs open in the browser's viewer when linked. Add a Button with the Open URL action (paste the asset's Public URL from the details panel; tick Open in a new tab) or the Download file action (set File URL and a File name).
- There is no dedicated PDF viewer component yet.
Other documents
DOC, DOCX, XLS, XLSX, PPTX, TXT, CSV and ZIP files are served as downloads: opening their URL saves the file instead of displaying it. Offer them with the Download file action or a link.
Button "Download price list"
onClick → Download file
File URL: https://your-app.example/api/files/ws_…/price-list.pdf
File name: price-list-2026.pdfFinding the URL
Select the file in Assets; the details panel shows the Public URL with a copy button and an open in new tab icon. Anyone with the link can view the file.
Common mistakes
- Expecting an SVG with scripts to animate. Scripts are stripped; use CSS animations inside the SVG or a GIF/WebP instead.
- Uploading a PDF as the Image source. The Image component shows images only; link the PDF instead.
- Private documents in Assets. Asset URLs are public; keep confidential files in records with permissions instead (file fields and upload inputs).
- Replacing a document and keeping old links. Replacing changes the file's URL; components that reference the asset update automatically, but copied URLs in Open URL actions do not — paste the new URL.
Related
Advanced
sanitizeSvg removes <script>, <foreignObject>, on* attributes, javascript: hrefs and <!ENTITY> declarations. /api/files serves .svg with Content-Security-Policy: default-src 'none'; style-src 'unsafe-inline'; sandbox, every file with X-Content-Type-Options: nosniff, and non-image/video/audio/font/PDF types with Content-Disposition: attachment.