© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
SupabaseS
Supabase•4y ago•
3 replies
Charles de Dreuille

Is it possible to send a file to an edge function and save the file in Supabase storage?

I'm having a hard time sending a file to an edge function for it to be saved. Perhaps this is not the right thing to do but I was wondering if this was possible.

const file = e.target.files[0];

let formData = new FormData();
formData.append("file", file);

const { data, error } = await supabaseClient.functions.invoke(
  "media-upload",
  {
    body: JSON.stringify({
      file: formData,
    }),
  }
);
const file = e.target.files[0];

let formData = new FormData();
formData.append("file", file);

const { data, error } = await supabaseClient.functions.invoke(
  "media-upload",
  {
    body: JSON.stringify({
      file: formData,
    }),
  }
);


This is how I send my file to the edge function but inside the function I can't do
file.getAll("file")
file.getAll("file")
.

Anyone knows what I'm doing wrong?
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

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

Is it possible to invoke an edge function from web client?
SupabaseSSupabase / help-and-questions
4y ago
is it possible to create an edge function in supabase itself instead of through terminal?
SupabaseSSupabase / help-and-questions
13mo ago
"Failed to send a request to the Edge Function" - but function got invoked
SupabaseSSupabase / help-and-questions
3mo ago
What is the function of "Edge Function"?
SupabaseSSupabase / help-and-questions
3y ago