Back

Image view giving 404 when mode=admin not added to the image url although the user has permission

  • 0
  • Web
  • Storage
yasmeen
27 Jan, 2024, 19:14

if i use this url : {baseUrl}/v1/storage/buckets/{bucketId}/files/{fileId}/view?project={projectId} i get this message error:

TypeScript
    "message": "The requested file could not be found.",
    "code": 404,
    "type": "storage_file_not_found",
    "version": "1.4.13"
}```

but if i use this url {baseUrl}/v1/storage/buckets/{bucketId}/files/{fileId}/view?project={projectId}&mode=admin
the image gets rendered correctly
TL;DR
Developers are facing an issue where an image view gives a 404 error when the "mode=admin" parameter is not added to the image URL, even though the user has the necessary permission. The URL format is "{baseUrl}/v1/storage/buckets/{bucketId}/files/{fileId}/view?project={projectId}". When this URL is used without the "mode=admin" parameter, the error "The requested file could not be found" with code 404 and type "storage_file_not_found" is received. However, when the "mode=admin" parameter is added to the URL, the image is rendered correctly.
Drake
27 Jan, 2024, 19:37

Are you using this URL in the browser address bar or in an img element?

yasmeen
27 Jan, 2024, 19:42

i tired it in both the img tag and the the browser address bar

yasmeen
27 Jan, 2024, 19:44

but eventually i want to use it as an image element src

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