Page 2 of 2

Record video and upload to database

Posted: Fri Aug 02, 2013 2:53 pm
by Kateryna Grynko

Hi Esau,

The mechanism is similar to saving the image as a base64 string. But this will make your app very slow.

Do you want to try to work around the limitation of uploadable files larger than 2MB?


Record video and upload to database

Posted: Tue Aug 06, 2013 4:13 am
by Esau Romano

Yes please, i would like to limit it to 30 seconds


Record video and upload to database

Posted: Tue Aug 06, 2013 4:31 am
by Esau Romano

could you also post how can i turn it to base64 string it migth be slower, but maybe i can get it to sync whenever there is wifi


Record video and upload to database

Posted: Tue Aug 06, 2013 1:07 pm
by Kateryna Grynko

Hi,

The problem is not in download speed, but in speed of conversion from/to base64 on device. It's not that ease to affect this.


Record video and upload to database

Posted: Mon Jul 28, 2014 2:09 pm
by Jennifer Liu

Hi, so my app records a video, and I used the FileTransfer sample code, but it didn't work. Is it possible if you could type out what kind of code I can use to transfer the video file to a collection I created called Video. Thanks

I also used this code in my button, but I can't manage to upload it onto the server.

var captureSuccess = function(mediaFiles) {
var i, path, len;
for (i = 0, len = mediaFiles.length; i < len; i += 1) {
path = mediaFiles.fullPath;
alert(path);
// 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, {limit:1});


Record video and upload to database

Posted: Tue Jul 29, 2014 11:18 am
by Evgene Karachevtsev

Hello Jennifer,

You don't load file anywhere. You have such comment:
pre&#47;&#47; do something interesting with the file/pre
instead of loading code.
Please look at details here:
https://getsatisfaction.com/apperyio/...


Record video and upload to database

Posted: Tue Jul 29, 2014 4:07 pm
by Jennifer Liu

Hi thanks for responding, here I have modified the code, but it still does not work. Why is that?

var captureSuccess = function(mediaFiles) {
var i, path, len;
for (i = 0, len = mediaFiles.length; i < len; i += 1) {
uploadVideo(mediaFiles);
}
};
// Upload file to file database server

// 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, {limit:1});

function uploadVideo(mediaFiles){
var ft = new FileTransfer(),
path = mediaFile.fullPath,
name = mediaFile.name;

Code: Select all

     ft.upload(path, 
         "[url=https://api.appery.io/rest/1/db/files]https://api.appery.io/rest/1/db/files[/url]", 
         function(result) { 
             alert("Upload success:" + result.responseCode); 
         }, 
         function(error) { 
             alert("Error uploading file" + errorThrown); 
         }, 
         { fileName: name });    

}


Record video and upload to database

Posted: Wed Jul 30, 2014 9:21 am
by Evgene Karachevtsev

Hello,

Please find our reply here: https://getsatisfaction.com/apperyio/...