Hi
Do you have any recommend to implement a simple progress bar when a file is uploaded from the app to an external server via the FileTranfer function?
thanks
Hi
Do you have any recommend to implement a simple progress bar when a file is uploaded from the app to an external server via the FileTranfer function?
thanks
Hello!
Please check this post https://getsatisfaction.com/apperyio/...
You can also implement suctom spinner http://devcenter.appery.io/documentat...
Thank you Maryna
I follow the link but something don't work.
i've insert the progress bar code in this way.
code
var captureSuccess = function(mediaFiles) {
var i, path, len;
for (i = 0, len = mediaFiles.length; i < len; i += 1) {
uploadFile(mediaFiles);
// do something interesting with the file
}
};
// capture error callback
var captureError = function(error) {
navigator.notification.alert('Error code: ' + error.code, null, 'Capture Error');
};
// start video capture
navigator.device.capture.captureVideo(captureSuccess, captureError, {duration:100});
// Upload files to server
function uploadFile(mediaFile) {
var ft = new FileTransfer(),
path = mediaFile.fullPath,
name = mediaFile.name;
Code: Select all
ft.upload(path,
"http://www.100stili.com/uploadVideo/index.php",
function(entry) {
Appery( "panelName" ).progressbar({
value: 32
});
},
function(result) {
alert('Upload success: ' + result.responseCode);
console.log(result.bytesSent + ' bytes sent');
},
function(error) {
alert('Error uploading file ' + path + ': ' + error.code);
},
{ fileName: name });
} /code
and i've create a new javascript file with the code suggested, and paste the css code in a custom style file.
can you help me?
thanks
Are there any errors in console?
nothing.
this piece of code is correct?
code
ft.upload(path,
"http://www.100stili.com/uploadVideo/index.php",
function(entry) {
Appery( "panelName" ).progressbar({
value: 32
});
},
/code
Hello Diego,
It doesn't seem to be correct
Please check what settings you specify for the upload method. You may find more info here:
http://docs.phonegap.com/en/3.3.0/cor...
Please read about onprogress method there too