0

I'm having a problem like a file upload code.

The user begins to upload files through the site (for large files. Like Wetransfer) Showing percentage loading with Ajax.

When completed, showing warning.

But the problem starts here.

Because files are huge, it takes time to move to the appropriate folder and ziping.

If the user closes the browser in this process, the process can not be completed.

Even users close the browser, how do I ensure that the operation continues.

I tried to ignore_user_abort. But I was not successful.

  • 2
    I don't think that is possible. After all, User wants to upload a file and then if (s)he decides to stop, why would you want to continue? Though, I am curious to know if that is even possible? – Bhavik Shah May 25 '16 at 11:26
  • You could consider showing an alert like (http://stackoverflow.com/questions/13227127/how-to-show-alert-message-when-closing-a-window) but like @BhavikShah said there is nothing you can do to stop the user shutting their browser. – mic May 25 '16 at 11:43
  • Uploads ends. Server-side processing begins. File moving, zipping like to record to the database. – Volkan Tutkun May 25 '16 at 12:39

1 Answers1

0

So send response to the browser that you are moving file, and or do it as queue and execute it as background job or just do it in your script. That should help: https://stackoverflow.com/a/5997140/4099089

Community
  • 1
  • 1
michaJlS
  • 2,465
  • 1
  • 16
  • 22