how are you reading the file? there's a method in node-appwrite https://appwrite.io/docs/references/cloud/server-nodejs/storage#getFilePreview
i've also trying with path function also same thing
the path function is for uploading
yes i have ready it too it base on this doc that i've write my code so
ok, so after you're doing the upload you can see the actual file in the bucket inside the appwrite console?
yes the file is in the storage
now you wanna get the file url for preview/download in nodejs
not a browser correct?
if so node-appwrite
return the file in buffer format, then depending on what you wanna do with the file (send it to a browser, or store it in the server requesting the file) you have to handle that yourself
is that it?
no in fact i have already have the file in a physical folder right ? so im just trying tu send in to the selfhost storage file and the upload is ok... but the problem is on the preview
i want tu upload it yo the self hosted and
are you being able to upload the file from your code and after that the file is present in the console?
by console I mean Appwrite console
exactly
but the content of the is different
so you can mark this task as complete
ok different how?
after uploading the file the content is being different?
after uploading the file what are you seeing in storage in the console same place the screenshot?
ok so i have the file imag.jpg that's i on my folder and when you open in my comput the file is open normaly but after upload it usind node-appwrite sdk storage function SelfHoted_storage.createFile(
bucket.$id,
element.$id,
InputFile.fromBuffer(file, ${element.name})
the file content in console have change to �����JFIF���������ICC_PROFILE��������0��mntrRGB XYZ ......
text
but if i'm using the sonsole everthing work fine
can you post the code?
I just test it an upload from node-appwrite 12.0.1
and it's working fine
maybe the 8.0 is not forward compatible
ok i will try to upgrade the libray and test
Recommended threads
- Storage files aren’t showing on mobile
hi, what can be the problem? i have a storage and there are images in it, the permissions are read for All Users, everything is fine on desktop, but on mobile t...
- Delete storage files all at once
I am using Appwrite Cloud. I want to delete all storage files in my bucket similar to how I can select all documents in a collection and delete them all at once...
- Storage images are not showing on mobile
Hi, can anyone help me? I have some images on the storage, and it is not shown on mobile, on desktop everything is fine.