File upload fails when phone screen turns off

249 Views Asked by At

In my web app, when submitting a form with a file to be uploaded, if the user pushes the button to turn the screen off before the upload finishes, it doesn't get uploaded. I'm assuming this is because the browser has been put into the background to sleep. I've searched for the answer here for how to approach this problem, but haven't found anything for a web app. Is there a way to keep the browser awake in the background until the file upload finishes, or a way to detect when the browser sleeps and then wakes up, or should I just show the user a message to Please Wait and hope they don't shut the screen off?

1

There are 1 best solutions below

0
On

I didn't receive any responses. What I ended up doing is just showing a "Uploading..." message with a spinning loader. I'll update my post if I find a better way to handle this.