
check this

is it same in your code?

/files/${fileId}

yes

hmm

I have this:
const response = await fetch(
`https://cloud.appwrite.io/v1/storage/buckets/${bucketId}/${fileId}`,
requestOptions
); // here is var

ho almost

I copied the updated code quickly

const response = await fetch(
`https://cloud.appwrite.io/v1/storage/buckets/${bucketId}/files/${fileId}`,
requestOptions
); // here is var

use this

Same error

ok

let use appwrite sdk

let me test it on my project then i will share the code.

Ho, thank you !

avatars.getInitials(userName, 64, 64).then((buffer) => {
fs.writeFile("image.png", buffer, (err) => {
if (!err) {
sharp("image.png").toFile("output.png", (err, info) => {
if (!err) {
console.log("Image was successfully converted:", info);
storage.createFile(
bucketId,
"MyFidddleID",
sdk.InputFile.fromPath("output.png", "Tesdst.png")
);
}
});
}
});
});

This code seems to work !!!!

Thank you for your help 🙂

One thing strange if I execute the code, remove the file in Appwrite storage re-execute the code after changing the userName
I get the old file

Cool

Maybe due to cache image data on your frontend.

Or it shows same on storage console too?

No it shows the same on the console.

I was able to fix the problem by remove the file with the sdk not from the console

Okay
Recommended threads
- API preflight request not working on .f...
When I am calling a function on my APP through the domain is failing. Because the preflight request (OPTIONS HTTP request) times out. this only occurs with fu...
- How to run queries to get the storage li...
I installed the n8n (self-hosting) and community node n8n-nodes-nappwrite. I tried to get the storage list files more than 25 records. But I cannot find the w...
- No Headers
Hi I have 2 appwrite functions, one is working fine on localhost, second is not even working on prod with https, i inspected the api call, no headers are being ...
