I have a problem with ios and ngcordova fileupload. Somehow i get an error code 1 in ios but i dont know why.
This is where i retrieve the image from camera
$scope.getPictureFromCamera = function(){
var options = {
quality: 50,
destinationType: Camera.DestinationType.DATA_URL,
sourceType: Camera.PictureSourceType.CAMERA,
allowEdit: false,
encodingType: Camera.EncodingType.JPEG,
targetWidth: 1000,
targetHeight: 1000,
correctOrientation: true,
popoverOptions: CameraPopoverOptions,
saveToPhotoAlbum: true
};
$cordovaCamera.getPicture(options).then(function(imageURI){ $scope.displayURL = "data:image/jpeg;base64," + imageURI; $scope.pictureURL = "data:image/jpeg;base64," + imageURI; }, function(error){ console.log(error); });
}
This is where i upload the image to my server
createPostWithPicture: function(post, pictureURI){
var url = domain+'/api/v1/statuses/create'; var filePath = pictureURI; var options = { "fileKey": "sphoto", "mimeType": "image/jpeg", "params": post }
return $cordovaFileTransfer.upload(url, filePath, options); },
In Android everything is working fine. In IOS i get an error with the following message:
FileTransferError { code = 1; source = data:image/jpeg;base64,…
I really cant find any solution to this. Help would be awesome!