I am developing a page which allows users to select files to upload to my server. While the files are being uploaded, if the user navigates to a different page (using the browser back button, for example) or close the browser, the files will not be uploaded successfully. What would be a usable way to implement a notification?

  1. Open a Javascript popup that notifies the user (and have the Leave this page / Cancel buttons)
  2. Change the upload progress so it opens a modal dialog, showing a progress indicator and an obvious message that the user shouldn't navigate away or close the browser (it wouldn't prevent the user from navigating away or closing the browser, but at least it's obvious something is running)
  3. Do nothing -- assume most users are aware?
  • Note that browsers no longer allow much JavaScript on the page unload event... you can no longer have a custom message, for example. (It got abused by the usual scummy scammers and ilk).
    – Erics
    Commented Feb 22, 2012 at 2:19

6 Answers 6


Other way is to show clearly what is happening , like showing the percentage of uploaded data or a good progress bar and time remaining.

This makes most of the users to wait for it and a javascript popup is always safe to keep for accidental navigation.


I would say a combination of one and two,two for the reason that you initially inform the user that navigating away from the page would cause the upload to fail and one as a sharp reminder just in case users have forgotten due to it being a large upload and are not paying attention to the screen


Why not open the 'background task' in a separate window? Closing that window would mean the user has chosen to abort the background task. (User can close the regular window independently at will).


Ask yourself the following questions:

Are your users likely to need to carry out using your site or app while the file is loading?

  • If there's a strong likelihood that they will need to carry out other tasks, you could aim to find a technological solution to the problem; possibly firing the process in a second window, which can be left unattended.

How long is the upload likely to take? What's the maximum realistic time they might wait?

  • Sometimes a clear indication of wait time is enough to reassure your user and allow them to use their wait time productively on another separate task / activity


If you do need to offer a prompt, I would suggest you:

  • Provide a graphical indicator which provides an indication of how the process is progressing.
  • Provide a confirmation message via a modal dialog if they attempt to leave the page.

I personally like status notifications. What comes to mind first is the brief status update you may see from an IM client or MS Outlook.


Always assume that users are not aware of what is going on when they start the execution of an operation.

If a user initiates an operation, that will some time to end, you can allow the user to leave the page and get the result in asynchronous way (such as e-mail or notification).

In cases such as file uploading, where something from the user machine is transferred to the server, it is essential to notify user about the operation with an upload progress, an obvious message and a cancel button to give the user the option to cancel the operation.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.