
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
- Error Migration Cloud to Self Hosted
Hello ! When doin migration, here is the message i've got : "Error occurred while pushing 'document:67efa41b00259efefe84' to destination with message: 'I...
- 404 Not Found when viewing document (con...
When viewing a document in console 6.1.23 i have an issue where the page displays a 404. Going back to 6.0.13 made it work again. When looking at the requests ...
- Cannot build angular 20 sites
The openruntime node 22 version is 22.9 and angular 20 requires 22.14 or above. Could you please release a new openruntime node 22 version for angular 20 ?
