Back

Cannot download file for user on appwrite cloud

  • 0
  • Cloud
ianmont
21 Sep, 2023, 18:32

I have a bucket called "STORE_FILES" which are files that when a user purchases something on my site, a "read" permission is added for that user to the file so that they can download the product.

The problem is that the user cannot download the file and says an error "{"message":"The requested file could not be found.","code":404,"type":"storage_file_not_found","version": "0.11.3"}"

As if the file does not exist, but when I enter the bucket and search for the file it does exist

And within the file the user who bought does has read permissions, so I don't understand why he can't download the file

I also checked the download link path and it looks good, what could be happening?

Im using appwrite cloud

TL;DR
User is experiencing an issue where a user cannot download a file on the Appwrite Cloud. User suspects it could be a 3rd party cookie problem. User asks for suggestions on how to check if the cookie exists and if it's included in the request. User also mentions that the user who purchased the file has the necessary permissions to download it. User is using JavaScript Appwrite SDK version 10.1.0. Solution: It is suggested to try allowing 3rd party cookies for testing. Additionally, enabling preserve logs can help keep the logs on refresh. Assuming the issue is not related to storage, user is advised to
ianmont
21 Sep, 2023, 18:34

As other information that may be useful, I am doing this test on incognito mode and im using javascript appwrite sdk version 10.1.0

Drake
21 Sep, 2023, 18:35

How are you letting them download the file?

Drake
21 Sep, 2023, 18:37

i have a feeling this is a cookie problem

ianmont
21 Sep, 2023, 18:37

Its a button that executes the following:

ianmont
21 Sep, 2023, 18:37

Discord will probably lower the quality of the image but the code that matters most is the following:

ianmont
21 Sep, 2023, 18:37
ianmont
21 Sep, 2023, 18:38

maybe because im on incgonito?

Drake
21 Sep, 2023, 18:39

maybe you can try to check if the cookie exists and if it's included in the request?

ianmont
21 Sep, 2023, 18:40

let me check

ianmont
21 Sep, 2023, 18:48

I'm not sure how to check the cookie in the request, I'm still somewhat new to this dev stuff and still learning

but on my site theres a "cookieFallback" inside the localStorage. But on the url for downloading the file it does not appear nothing on localstorage, or cookies.

Also within the network tab on my site, I can't see the request because the page refreshes, is there a way to prevent it from refreshing on the browser or do I modify the code so that it doesn't?

ianmont
24 Sep, 2023, 06:03

I was making another test today and this error showed up in the console log

ianmont
24 Sep, 2023, 06:03

im no longer in incognito but testing in firefox browser

ianmont
24 Sep, 2023, 06:04

also the user does have permissions so i dont know still whats the problem 😦

Drake
25 Sep, 2023, 05:10

You can enable preserve logs to keep the logs on refresh

Drake
25 Sep, 2023, 05:11

This execute is a function error, not storage 🧐

Drake
25 Sep, 2023, 05:11

I still think this is a 3rd party cookie problem. You can try allowing 3rd party cookies to test

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