© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
SupabaseS
Supabase•4y ago•
44 replies
Juliano

Storage - download files in 1 request

I have a select request which gets information from a table. Among these information, I get the
bucket_id
bucket_id
and
path
path
of some files stored in the S3 storage. Is there a way to get the raw string file from within the select request or it's mandatory to perform a second request with the
download()
download()
method of the storage object like so:
supabase
  .storage
  .from(bucket_id)
  .download(path)
supabase
  .storage
  .from(bucket_id)
  .download(path)

Doing this in just 1 request would simplify the client side code and make the content appears all at once instead of having the text to appears and later on the images.

According to this: https://supabase.com/docs/guides/database/extensions/plv8#create-plv8-functions
I can use the JS extension and that will give me access to the supabase object inside database functions? I assume that by looking at the JavaScript example under the sentence:
You can call plv8 functions like any other Postgres function:
You can call plv8 functions like any other Postgres function:
. Is that true? If yes, I will be able to build a database function to select the info from the database & get the raw string from the S3 storage so that would be everything I need.

Otherwise, I suppose that I can do a normal postgresql database function to perform the select and use the HTTP extension to get the raw string from the S3 storage, I just have to grab the get url from the download method (I found it in the node_modules), right?
plv8: JavaScript Language | Supabase
JavaScript language for PostgreSQL.
Supabase banner
SupabaseJoin
Supabase gives you the tools, documentation, and community that makes managing databases, authentication, and backend infrastructure a lot less overwhelming.
45,816Members
Resources
Was this page helpful?

Similar Threads

Recent Announcements

Similar Threads

Not able to download files from storage bucket
SupabaseSSupabase / help-and-questions
2mo ago
Download Cold Storage
SupabaseSSupabase / help-and-questions
4y ago
Storage File Partial Download
SupabaseSSupabase / help-and-questions
2mo ago
Overage use of storage - zero files in storage [free plan]
SupabaseSSupabase / help-and-questions
4mo ago