Next.js Discord

Discord Forum

How to enforce server-side file validation when using Supabase Storage

Unanswered
Yellowfin tuna posted this in #help-forum
Open in Discord
Yellowfin tunaOP
Hi, guys. I have a Next.js app with two separate upload paths for a gallery feature. There's a post on Stack Overflow, so if you wanna help me, check out here: https://stackoverflow.com/questions/79941971/how-to-enforce-server-side-file-validation-when-using-supabase-storage-client-si. Please read the post and write answers with code on Stack Overflow. I hope you help me for real. Thank you.

3 Replies

Yellowfin tunaOP
@Yellowfin tuna Hi, guys. I have a Next.js app with two separate upload paths for a gallery feature. There's a post on Stack Overflow, so if you wanna help me, check out here: https://stackoverflow.com/questions/79941971/how-to-enforce-server-side-file-validation-when-using-supabase-storage-client-si. Please read the post and write answers with code on Stack Overflow. I hope you help me for real. Thank you.
It seems like this is happening because you are executing the supabase client function rather than the server action.

You can switch to use a server action, by directly importing and executing the server action in the client side, and then adding specific rules in supabase to disable client side uploads

If you need an upload progress, you have to use an API route, thats the only thing which is possible. You'll lose the simplicity, but that shouldn't be the thing concerning you if you need upload progress
also answered in stackoverflow