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
- Got message for auto payment of 15usd fo...
how did this happen? 1. i claimed my 50usd credits via jsm hackathon - https://hackathon.jsmastery.pro/ 2. it asked me which org. to apply the credits on, i se...
- Invalid document structure: missing requ...
I just pick up my code that's working a week ago, and now I got this error: ``` code: 400, type: 'document_invalid_structure', response: { message: 'Inv...
- Apple OAuth Scopes
Hi Hi, I've configured sign in with apple and this is the response i'm getting from apple once i've signed in. I cant find anywhere I set scopes. I remember se...