Closed simon-lund closed 10 months ago
Habe you tried doing the same thing like shown here on your protected file. My guess is that it works just out of the box. Every file in Pocketbase has always a sort of random id appended to the name. The only difference for protected files is that the random id will have a limited validity. This is enforced on the server side and should not need any explicit implementation on the client side.
(To refresh the ID you simply would call another get record query on the collection service and then pass the new result in the get_file_url method.
Hello, sorry I forgot to close this issues. I ended up imitating the getToken function from the js-sdk with the send(...)
method provided by the python-sdk. Afaik I need this token, otherwise it creates a permanent link.
Just in case anyones came across this issue:
from pocketbase import Client
class PocketBase(Client):
def get_file_token(self):
return self.send("/api/files/token", req_config={"method": "POST"})
Hello again ^^
does the SDK support protected files yet? See here: https://pocketbase.io/docs/files-handling/#protected-files
I couldn't find the respective method in the SDK, but maybe I overlooked it?