CallBack Progress js info

Hi, I’m using Backendless to upload files .I would like to create a progress bar, But How do I use the progress ?Backendless.Files.upload( files, TEST_FOLDER, true, callback);

callback.success = function(result)
{
}

callback.fault = function(result)
{
}

how to use progress ? this method doesn’t work!..

callback.progress = function(result)
{

}

Hi Tuxxo,

there is no progress method in SDK. You should implement progress bar/spinner yourself.
The way you can do it may looks like next:

function showSpinner(loading) {
 if (loading) {
 // show spinner here
 } else {
 // remove spinner
 }
}
 
 
 



showSpinner(true) // call before you make a request
Backendless.Files.upload(files, TEST_FOLDER, true, callback);
 
 
 



callback.success = function(result) {
 showSpinner(false);
 
 
 



 // do your staff here...
}
 
 
 



callback.fault = function(result) {
 showSpinner(false);
 
 // do your staff here...
}

Regards,
Stanislaw

I can buy a backendless already working solution ? i would like to have the progress in percent…
i unfortunately don’t have time to implement it.

Hi,

unfortunately we do not have ready solutions for this. If you want to show progress in percent, I recommend you to show random increasing value while request pending. After succeed response increase it to 100 and remove, and after error response just remove it.

Regards,
Stanislaw