Vote count:
0
I'm fairly new to collectionFS so I'm probably wrong somewhere. I try to use collectionFS on a mobile device. Recording audio and uploading it to a server. I followed the doc and it seems to work except the files won't show up in the defined upload-directory on the server. They are visible in the mongoDB though.
Images = new FS.Collection('images', {
stores: [new FS.Store.FileSystem('images', {path: '~/uploads/'})]
});
.
Template.main.events ({
'click #record': function (){
Meteor.startup(function () {
// capture callback
var captureSuccess = function(mediaFiles) {
var i, path, len;
for (i = 0, len = mediaFiles.length; i < len; i += 1) {
path = mediaFiles[i].fullPath;
// do something interesting with the file
upload(mediaFiles[i]);
}
};
// capture error callback
var captureError = function(error) {
navigator.notification.alert('Error code: ' + error.code, null, 'Capture Error');
};
// start audio capture
navigator.device.capture.captureAudio(captureSuccess, captureError);
});
function upload (file){
Images.insert(file, function(err, fileObj){
if (err) { console.Error(err);}
else { console.log('done');}
});
}
}
})
asked 1 min ago
CollectionsFS files won't upload to the Meteor server
Aucun commentaire:
Enregistrer un commentaire