Back

cannot download file from storage with permissions

  • 1
  • Web
  • Storage
DeFacedFace
20 Sep, 2024, 21:39

If i disable permissions and allow any user to download it works totally fine.

But without it, it does not work and would be a major security issue obv.

How I assign permissions in app

TypeScript
    const uploadedFile = await storage.createFile(
      process.env.APPWRITE_BUCKET_ID,
      fileID,
      file,
      [Permission.read(Role.user(userID)), Permission.write(Role.user(userID))],
    );
TL;DR
Developers can download files from storage if permissions are disabled. However, with permissions enabled, the download fails. To assign permissions in the app, the code snippet provided is utilizing `Permission.read(Role.user(userID))` and `Permission.write(Role.user(userID))`.
DeFacedFace
20 Sep, 2024, 21:48
Reply

Reply to this thread by joining our Discord

Reply on Discord

Need support?

Join our Discord

Get community support by joining our Discord server.

Join Discord

Get premium support

Join Appwrite Pro and get email support from our team.

Learn more