Kateryna Grynko
Posts: 0
Joined: Thu Nov 15, 2012 9:13 am

Record video and upload to database

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?

Esau Romano
Posts: 0
Joined: Sun Jun 02, 2013 7:03 pm

Record video and upload to database

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

Esau Romano
Posts: 0
Joined: Sun Jun 02, 2013 7:03 pm

Record video and upload to database

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

Kateryna Grynko
Posts: 0
Joined: Thu Nov 15, 2012 9:13 am

Record video and upload to database

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.

Jennifer Liu
Posts: 0
Joined: Mon Jul 28, 2014 2:09 pm

Record video and upload to database

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

Evgene Karachevtsev
Posts: 12
Joined: Mon Apr 28, 2014 1:12 pm

Record video and upload to database

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/...

Jennifer Liu
Posts: 0
Joined: Mon Jul 28, 2014 2:09 pm

Record video and upload to database

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

}

Return to “Issues”