
I want to get url of stored file and use it in document while storing it in database ...
const storedPhotoDetails = await storage.createFile(
'bucket-id',
uuidv4(),
InputFile.fromBuffer(photobuffer, photo.name))
// Get URL of stored file
try {
const storage_url = await storage.getFile(
'bucket-id',
storedPhotoDetails.$id)
console.log(storage_url)
} catch (error) {
console.log(error)
}```js

Is this with the web sdk? Or node?

No I m using server SDK (in Next js project)

Node

You would need to build the url manually. See the web sdk: https://github.com/appwrite/sdk-for-web/blob/ca4ef6dd0f8d7110db57f8b3b295ce62e629eec5/src/services/storage.ts#L314
We plan to introduce methods for building the url in all SDKs, but we haven't had time to focus on it. If you're interested in the feature, make sure to 👍 https://github.com/appwrite/sdk-generator/issues/557

Thanks @Steven
Recommended threads
- Getting Function error: Protocol "https:...
Hi guys, I have a function on node-16.0 runtime but whenever I try to run the function I keep getting this error. I have tried putting htttp:// in my endpoint b...
- Migrating from one self-hosted instance ...
I am trying to migrate from an older VM running Appwrite 1.6 to a new VM with the latest version. On my new VM running Appwrite 1.7.4 I am going to migrations...
- Flutter docs
Flutter documentation is so bad, the api is for web version and you dont support self host, also you can't find anything, for now im staying with supabase, your...
