4

I am new to Pocketbase. I found that Pocketbase offers an S3 file system config but I dont know how to set it up completely. Currently, I am uploading my images to S3 separately then save the link to the DB. Screenshot

I am setting my bucket publicly accessible, if possible, do you know if I can set my bucket only accessible to pocketbase?

G3N
  • 141
  • 6

1 Answers1

4

I solved this issue!

endpoint: you can get your endpoint here

example: s3.us-west-1.amazonaws.com

you can check on your bucket item property, click on any of your bucket item and check its property, find a block called Object URL link of your bucket item

For the rest, I have written in my tech blog, feel free to check them there.

G3N
  • 141
  • 6
  • Thanks for the question and the answer you gave @G3N . I'm curious though, coz I also have project where I'm using pocketbase, but want the files eventually stored on S3. The pocketbase sdk has a function to generate a url to stored files. I wanted to know how it works when used with S3. Like, what kind of url is generated etc – Bankole Alex-Esan Mar 28 '23 at 19:32
  • 1
    @BankoleAlex-Esan Hi, after you set pocketbase up, the next upload will go to the S3 bucket. The file system on the S3 bucket is using randomly generated keys, the pattern is {folder for your whole project}/{uploaded file folder}/{thumbnails and more} on the Pocketbase, it is saved as {randomly generated key}.{file type extension} the only way to get the URL is by the documentation getFileUrl function – G3N Apr 03 '23 at 13:47