vercel / storage

Vercel Postgres, KV, Blob, and Edge Config
https://vercel.com/storage
Apache License 2.0
517 stars 58 forks source link

Vercel blob: url vs downloadURL? #689

Closed Swoopify closed 5 months ago

Swoopify commented 5 months ago

I have a functionality that a user can upload an avatar clientside on my website. I store the uploaded avatar in my vercel blob storage and it returns me a blob object with following included properties: url, downloadUrl. What is the difference between theese urls and when I should use which? Which url I should store in my sql database to display the avatar later?

vvo commented 5 months ago

@Swoopify To display the avatar on a website, you can store url.

downloadUrl is a convenience property that will ensure, when opened by a browser, the file will be downloaded to your user's computer.

downloadUrl is ${url}?download=1

Let me know if this is clear or not 👍

Swoopify commented 5 months ago

@Swoopify To display the avatar on a website, you can store url.

downloadUrl is a convenience property that will ensure, when opened by a browser, the file will be downloaded to your user's computer.

downloadUrl is ${url}?download=1

Let me know if this is clear or not 👍

Thank you, now it is clear for me ^^