Quantcast
Channel: Active questions tagged svelte - Stack Overflow
Viewing all articles
Browse latest Browse all 1541

Client Upload to Vercel Blob using Svelte

$
0
0

I am trying to replicate the next.js code to svelte

https://vercel.com/docs/storage/vercel-blob/using-blob-sdk#upload

It asks for giving a path to run a server side function which I don't know about implementing in svelte

handleUploadUrl Yes* A string specifying the route to call for generating client tokens for client uploads.

Next.js Version

const newBlob = await upload(file.name, file, {            access: 'public',            handleUploadUrl: '/api/avatar/upload',          });

Let me know how I can provide a url which exports a function to carry out

onBeforeGenerateToken

onUploadCompleted

I have my secret key as an environment variable.

I have tried to put a file in the routes directory, but I am getting an error which says path not found.


Viewing all articles
Browse latest Browse all 1541

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>