Skip to content
Back

File tokens regenerate each page reload

  • 0
  • Self Hosted
  • Web
  • Storage
  • REST API
IRules
18 Oct, 2025, 17:37

Hello,

on appwrite 1.7.4, when I create a file token via the API Tokens(appwriteAdminClient)#createFileToken I get a secret, then when I check in the console there is another secret for the same file token. I am using expireAt ( 30 days ). The bucket has file security turned off. It was the same when I turned it on.

When reloading the page, the file token keeps changing, rendering the token unusable.

I don't understand how to use them ( I guess? ), can you please tell me what I am doing wrong. In the URL, I am parsing directly the secret I get from creating the token. I want to let users create a donwloadable file with an expiration date so they can share it further with friends.

TL;DR
Issue: File tokens are regenerating upon each page reload, causing the token to become unusable. Solution: The issue is likely due to the way the file token is being handled or parsed. Make sure to properly manage the file token and store it securely to maintain its consistency across page reloads. Review how the secret is being parsed in the URL to ensure it remains constant.
IRules
18 Oct, 2025, 17:45

Forgot the error: {"message":"The current user is not authorized to perform the requested action.","code":401,"type":"user_unauthorized","version":"1.7.4"}

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