how are you reading the file? there's a method in node-appwrite https://appwrite.io/docs/references/cloud/server-nodejs/storage#getFilePreview
The type of file change when upload
Votes
0
Replies
24
Participants
Unknown
Messages
25
Rank 2: Process
i've also trying with path function also same thing
the path function is for uploading
Rank 2: Process
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?
Rank 2: Process
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?
Rank 2: Process
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
Rank 2: Process
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
Rank 2: Process
exactly
Rank 2: Process
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?
Rank 2: Process
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
Rank 2: Process
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
Rank 2: Process
ok i will try to upgrade the libray and test