I want to upload image, to Cloudinary, taken directly from camera in Ionic using cordova camera plugin. I am getting an error of code 1, having message "upload preset must be in whitelist for unsigned uploads." How to solve this error.Please help.
my edited js code is:
$scope.cameraopen = function(){
var options = {
quality : 100,
destinationType : Camera.DestinationType.FILE_URI,//FILE_URI
sourceType : Camera.PictureSourceType.CAMERA,
allowEdit : false,
encodingType: Camera.EncodingType.JPEG,
popoverOptions: CameraPopoverOptions,
targetWidth: 500,
targetHeight: 500,
saveToPhotoAlbum: true
};
$cordovaCamera.getPicture(options).then(function(imageData) {
var Uploadoptions = {
upload_preset: cloudinary.config().upload_preset,
tags: 'mytag',
context: 'photo=photo',
file: imageData
};
var onUploadSuccess = function(data){
console.log("success"+JSON.stringify(data));
}
var onUploadFail = function(e){
console.log("error"+JSON.stringify(e));
}
var ft = new FileTransfer();
ft.upload(imageData, "http://api.cloudinary.com/v1_1/" + cloudinary.config().cloud_name + "/upload", onUploadSuccess, onUploadFail, Uploadoptions, true);
}, function(err) {
// error
});
}