Is there any way to export private files?

Hi everyone,

I’m trying to export the files I have in my database via API, but I discovered that it’s not possible to encode to base64 files that are private. Is there any way around this or any quick way to export a large list of files? Thanks!

If you are trying to get file from outside Bubble, you need to auth with API key (?api_token=yourapikey after file url, or Authorization: Bearer apikey if allowed). However, this is less secure so it’s to be used carefully.

Thank you @Jici! I’m using the token I’ve created with Authorization: Bearer, but it seems that the encode to base64 does not apply for private files even if you’re logged in.

Can you share some screenshot of what you are trying todo?

I’m retrieving a file from the database, then converting it to base64 and returning it to the API. See image below.

Thanks!

You will hit the 50M limit of API requests trying to do it that way (base64 encoding) …
Read about that here - Hard limits | Bubble Docs

What you can do is take the URL - with the token @jici mentions and get a signed URL to pull the file content. with api_token=xxxxx as a parameter.

1 Like

You are fetching the file using API Connector?
Read this:

Bubble cannot encode it in base64. You need to use a plugin to retrieve the file and encode it as base64

1 Like

This topic was automatically closed after 70 days. New replies are no longer allowed.