Skip to content
Back

getFilePreview , getFileView , getFileDownload not working

  • 0
  • Self Hosted
  • Storage
Kompozition
5 Nov, 2025, 20:27

I am on Appwrite self hosted 1.8.0 I use the web sdk 21.3.0

I created a bucket and it has this permission (users:create) then i enabled the file security then i uploaded a file via the sdk and i passed the permission ( team: read, update, delete) and ( loggedInUser: read, update, delete)

When i use the SDK to get the image it fails, all 3 methods gives me 404, end the network tab shows (failed)net::ERR_BLOCKED_BY_ORB

When i set the entire bucket to fully public ( or all users can read ) then i get the image properly

If i get the link from Appwrite's dashboard i get the <,&mode=admin >> in the generated url then the file shows in the browser,

The link from the dashboard is same as the link from the sdk apart from the "mode"

I am not sure why this is not working here is the code i used

TypeScript
   return appwriteStorage.getFilePreview({
    bucketId:ServerStorageBucketIds.photos,
    fileId:photo.objectID,
   })
}
TL;DR
Developers are facing issues with getFilePreview, getFileView, and getFileDownload methods in Appwrite. The problem arises from incorrect permissions settings. Changing permissions to allow all users to read resolves the issue. The code provided seems to be correct.
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