What is the best way to handle uploading a video to AWS s3 ?
- Directly upload from the UI thread.
- Use Isolates
- User
workmanager
package
My use case is:
- Uploading should continue if i kill the app
- Should able to retry the upload from where the uploading paused
I don’t recommend uploading on the UI thread it will freeze everything until the upload is done.
Isolates are always a good choice for long-running operations
for uploading while the app is closed you need a background process so something like workmanager works and you can also try the background downloader package which supports upload as well.
for retry, you can use the retry package it’s handy.
Note: You should make sure you upload as stream and don’t load the whole video in memory as you may run into a buffer overflow or simply run out of device memory altogether and crash the app.
1 Like