Back

[SOLVED] getFileDownload / View / Preview error 401 (frontend localhost + appwrite self-hosting)

  • 0
  • Web
  • Storage
𝕂𝔸ℕ𝔾
20 Sep, 2023, 02:36
<Please see my attached picture for more details> My bucket had CRUD permission setting for team:admin (see picture), and I had joined team:admin, but I cannot getFileDownload / View / Preview, It throw 401 error. I'm currently dev frontend at localhost and appwrite self-hosting v1.4.2 on my VPS. Thanks for any help!
TL;DR
Title: [SOLVED] getFileDownload / View / Preview error 401 (frontend localhost + appwrite self-hosting) - This issue was resolved. - The problem was related to a 3rd party cookie issue. - One solution is to update your browser to enable 3rd party cookies. - If you don't have a domain, you can update your hosts file to fake a domain. - In production, your Appwrite endpoint should be a subdomain of your app. - Make sure you are using the correct URL in the img src to display the image. - Check the CRUD permission settings for your bucket. -
Drake
20 Sep, 2023, 03:45

Are you showing the image by using the url in an img src?

Drake
20 Sep, 2023, 03:51

You might be facing a 3rd party cookie problem.

One thing you can do more is up update your browser to enable 3rd party cookies.

In production, your Appwrite endpoint should be a subdomain of your app. See https://appwrite.io/docs/custom-domains

𝕂𝔸ℕ𝔾
20 Sep, 2023, 04:16

I getFileDownload().href and attach it to <img src="<href>"> I'm using EDGE on Mac with default configuration I currently don't have a domain yet and connect to appwrite by IP, is it ok?

Drake
20 Sep, 2023, 04:18

Ya this is probably a 3rd party cookie problem.

If you don't have an actual domain, you can update your hosts file to fake a domain

𝕂𝔸ℕ𝔾
20 Sep, 2023, 04:20

I'm now understand, Thank you!

𝕂𝔸ℕ𝔾
20 Sep, 2023, 04:21

[SOLVED] getFileDownload / View / Preview error 401 (frontend localhost + appwrite self-hosting)

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