Comments (3)
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"})
from pocketbase.
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.
from pocketbase.
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.
from pocketbase.
Related Issues (20)
- AdminService delete + update methods do not work
- version 0.8.2 actually isn't in pypi HOT 1
- Typo in function argument for auth_with_oauth2 method
- TypeError when expanding relations. HOT 6
- Pocketbase v0.18 api change breaks SchemaField unmarshaling
- Subscribe example HOT 2
- Remove class variables HOT 3
- Incorrect last pocketbase version? HOT 1
- Back-relation expand HOT 4
- log service broken with pocketbase >=v0.20.0
- Issues deleting keys while iterating a list of dictionary HOT 2
- TypeError() raise when calling `client.collections.get_full_list()` HOT 2
- SSE thread will die silently HOT 1
- How to use the transaction, did not find the corresponding transaction package interface HOT 1
- .collections.get_full_list() error HOT 4
- [help-wanted] How can I create a Collection API hook? HOT 2
- [Help] How to get record data ... ? HOT 2
- [Help] How to check if token is valid or has expired HOT 1
- Support backup API HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pocketbase.