Skip to content

Tell Pocketbase to pick up a file already at the storage location without going through the API #4858

Answered by ganigeorgiev
thangngoc89 asked this question in Q&A
Discussion options

You must be logged in to vote

Given that I have the ability to directly save the file to the S3 location, I would like to somehow tell Pocketbase that the file is already present

In the database we store only the record file name. If you have uploaded the file externally in /collectionId/recordId/file_name_random10chars.ext location then in this case you can directly set the name of the file as your record field value.

record.Set("yourFileField", "file_name_random10chars.ext")
app.Dao().SaveRecord(record)

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@thangngoc89
Comment options

Answer selected by thangngoc89
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants