ext-uploader
Let mobile users upload images to your app via QR code.
How it works
- Your server requests an upload token.
- Build a signed URL and render it as a QR code.
- The mobile user scans, picks images, and submits.
- Uploaded image URLs are POSTed to your callback webhook.
1. Get a signed upload URL
Call this from your server — never from the browser.
const res = await fetch('https://ext-uploader.pages.dev/api/upload-url', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
key: 'session-123',
callbackUrl: 'https://your-server.com/webhook',
}),
});
const { uploadUrl, expiresAt } = await res.json();2. Render the QR code
Pass uploadUrl to your page and render it with the QRUpload component:
// +page.server.ts
export const load = async () => {
// fetch uploadUrl from step 1
return { uploadUrl };
};3. Handle the callback
After the mobile user uploads, your webhook receives a POST with the public image URLs:
// POST https://your-server.com/webhook
{
"images": [
"https://your-bucket.supabase.co/storage/v1/object/public/uploads/abc.jpg"
],
"hash": "…",
"expires": "2025-11-01T00:00:00.000Z"
}