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
- Error getting preview of file
Rest Response: ``` { "message": "Server Error", "code": 500, "type": "general_unknown", "version": "1.8.1" } ``` Appwrite Logs ``` appwrite ...
- Storage images using custom domain retur...
Some of the images uploaded to my storage bucket returns this error: ``` { "message": "Project with the requested ID could not be found. Please check the value...
- Bandwidth limit for your organization ha...
I received an alert that I exceeded the Free plan bandwidth limit (showing 5.86 GB), but my dashboard tells a different story. The usage stats there are much lo...