
I keep getting " 'url' is valid but upstream response is invalid" when I try to fetch the preview using storage.getFilePreview
I am passing all the parameters correctly and the access at bucket level is set to CREATE for All Users and at file/image level it's set to READ, UPDATE, DELETE for the user that uploaded the file.
Yet I keep getting this error with a 404 status code

Can you share your code?

Are you passing in the jwt
with setJWT('eyJJ9.eyJ...886c4');
? Files that are not public (no guest) access can't be accessed without a jwt. Checkout this response by Steven https://discord.com/channels/564160730845151244/1157804153427460126/1158411341908934687
Link to Jwt docs: https://appwrite.io/docs/products/auth/jwt#proof-of-identity

I am using emailSession not jwt

Wait I'll just push the code to github and maybe that should provide more context

I think it doesn't matter you still need a jwt to access private files.

Ok


The code in feat/authentication branch is the one were I am implementing the auth atm

the call I make for getting file preview is in

lib > getUrl

this Url is used in components > TodoCard.tsx to display the image

store > AuthStore contains the methods like signup, login, googleLogin etc

it's weird, I do get the preview but I also get that 404

That's weird and I'm sorry I can't help. Just wait for a core team member or moderator to reply.

That's okay thanks for your time

Can you log the output of url?

See what the output is, cuz I don't think it should have anything.
According to the docs for getFilePreview, the response is just a 200 OK

Returns this

and using .toString on the url object returns the value of href as string

turns out everything is fine on appwrite side..... it's Next 13 that's causing it with it's mostly amazing but at time annoying Image component

I'll be deleting this branch so it will no longer be accessible anymore
Recommended threads
- My Cloud functions domain has changed.
I want to know why the domain name of my Cloud functions has changed? I used to use appwrite.global but it suddenly became appwrite.run these days. I want to us...
- Invalid redirect url
I keep getting invalid redirect url in Nextjs when i try to use google or github authentication
- Change of billing cycle to support start...
Hii...is there any way to change my billing cycle from 20th to 1st...so that I aligns with my requirements.It becomes easier to track monthly usage crctly. I am...
