Access Denied When Using Profile Picture URL in Custom Code Block

Hello Softr Support Team,

I’m currently building a feature using a Custom Code block and I’m trying to display a profile picture stored in my Softr Database.

When I use the image URL (the S3 link) inside an <img> tag, the image does not load and instead returns an Access Denied error. It appears the file is stored in a private S3 bucket, which prevents it from being accessed directly.

Could you please advise on the correct way to retrieve and use a publicly accessible image URL from a Softr Database file field within a Custom Code block?

Specifically:

  • Is there a supported way to access the proxied assets.softr-files.com URL?

  • Should I be using dynamic field binding instead of the raw file URL?

  • Or is there another recommended approach for rendering uploaded images inside custom HTML?

Thank you in advance for your guidance.

In a plain JS Custom Code block, use Softr’s globally available datasource.getRecords() to fetch the record at runtime — this returns a fresh presigned URL for the private S3 file, which you then extract from the returned attachment object (normalising for the fact it comes back as an array) and assign directly to your element’s src. As you have found, using a raw S3 URL directly will be expired or access-denied.​​​​​​​​​​​​​​​​

i used the raw file URL as profile picture URL in database and it worked thank you.