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);
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...
}
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.