
I was trying to decipher the documentation on this, anyone know how to get the file url? I am doing something like this and am getting the file.$id, but then when I try to get that json, it is empty. Do I need to create a new storage object or something?
// Upload the file to Appwrite Storage
const file = await storage.createFile(
config.appwriteFilesId, // Your Appwrite bucket ID
ID.unique(), // Use unique() for unique ID generation
inputFile // Upload the file buffer
);
console.log("File uploaded successfully. File ID:", file.$id);
// Get the URL of the uploaded file
const fileView = await storage.getFile(config.appwriteFilesId, file.$id);

think I figured this out: appwrite doesn't give you the full url, you have to construct it yourself from the metadata provided. You can do something like this:
const fileUrl =
${config.endpoint}/storage/buckets/${config.appwriteFilesId}/files/${file.$id}/view`;

No, I think appwrite do gives a file url. Can you console log the fileurl variable?

And can you share What kind of permission have you setup for your storage bucket?

use this method storage.getFileView("bucket id","file id")

You do only get the fileUrl when using the web sdk

why am i getting one?

I am also on react native

Mine works


Idk building my own works fine so stuck with that

that is kind of inconvenient. Although I also did this when I was making the first app and you dont want to build your link again and again do you? in future project?

just sayin Get fileView works so why not use it 🤷♂️

Yeah you're right

I achieved it with server + client sdk https://github.com/ArnabChatterjee20k/devsoc-gamenvt-ticket/tree/main/src/lib
Check the client and the server file for uploads
Recommended threads
- 500 Error on Console when Using Custom D...
Hey 👋 I’ve set up a custom domain for my Appwrite Cloud project (<my-custom-domain>). DNS is configured and the organization view loads fine when I open the c...
- 2 Columns still processing since yesterd...
Hey o/ Yesterday (around <t:1758045600:f>), I created a database and added several columns to it. After about 15 minutes, most of the "processing" tags disappe...
- 503 Timeout when Updating or Upserting D...
Hey I’m running into an issue when trying to update or upsert a row in Appwrite. The request hangs for a while and then throws this error: ``` AppwriteException...
