I am working with Ionic + Phonegap and sending to a Django server, and the code below correctly renders the image just taken on the iphone within the app itself on the iphone, but I can't figure out how to save the image on the server. I am sending the base64 representation of the image to the server, but am not sure how to save it on the server.
$scope.takePicture = function(){
var cameraOptions = {
quality: 50,
destinationType: Camera.DestinationType.DATA_URL
};
var success = function(data){
$scope.$apply(function () {
$scope.cameraPic = "data:image/jpeg;base64," + data;
var myImg = $scope.cameraPic;
var params = Auth.getUserCredentials();
params['user_image'] = myImg
Classify.classifyImage(params)
.success(function (data, status, headers, config) {
console.log(data);
})
.error(function(data, status, headers, config) {
console.log(data);
})
});
}
I tried the normal python write functions but none created a valid image in the end