File Manager: how to find out that upload is complete

I am using File Manager in a Rails application, and when I Upload a large file, the progress bar moves until the end, regardless of the size and regardless it has already uploaded the file to the server. The user then leaves the screen and the transfer is cancelled and the file is not uploaded.
Am I doing something wrong? How do I know that the upload is finished and ok? How do I tell the user that the upload has not finished yet?

Hi,

FileManager hides progress bar after receiving response.

Webix Uploader, that is used for file uploading, fires either onFileUpload or onFileUploadError event.

var uploader = fileManager.getUploader();
uploader.attachEvent("onAfterFileAdd", function(data){
   // uploading started
});
uploader.attachEvent("onFileUpload",function(data, response){
    // uploading finished
});
uploader.attachEvent("onFileUploadError",function(data){
    // error response
});