From the course: Supabase Essential Training

Unlock this course with a free trial

Join today to access over 24,700 courses taught by industry experts.

Uploading large files

Uploading large files

- You can use the Supabase JavaScript client to easily upload files that are six or fewer megabytes, but if the upload fails for a moment, you have to start over. Let's look at a solution for resumable uploads. Supabase storage supports the TUS protocol for resumable uploads. TUS stands for the upload server. There are client libraries such as TUS JS client and up EJS implementing TUS. When using TUS, an upload link will be created in Supabase, which will be valid for 24 hours. The upload is then split into chunks, and each is uploaded individually to the link. If the upload is interrupted, it can pick up with the failed chunk without starting all the way back in the beginning. Since the file is split into chunks, it is easy to report the progress back to the user as a percentage. For instance, if there are 100 chunks and 33 have been uploaded, the upload is 33% complete. This can be shown to the user. You can learn…

Contents