I need to save an image file in the column Adjunto
, I do not know
var comentario = new CB.CloudObject('Comentarios');
comentario.set("IdPersona", new CB.CloudObject("User", "4bD5Gz7Q"));
comentario.set("IdEmpresa", new CB.CloudObject("User", id));
comentario.set("Comentario", coment);
comentario.set("Calificacion", parseInt(calificacion));
comentario.set("Ubicacion", new CB.CloudGeoPoint(gps[0],gps[1]));
comentario.set("Adjunto",function(){
new CB.CloudFile(foto).set('name',"foto.jpg").save({
success : function(cloudFile){
alert(cloudFile.URL);
}, error: function(error){
alert("error: "+error);
}
});
});
comentario.save({
success: function(data){
alert("Exito!");
}, error: function(error){
alert("Error: "+error);
}
});
}
The param foto is an object $cordovaCapture.captureImage
named imageData[0]
.
You cannot set a function() to a column. That's not valid.
Try this instead :