ich ein Bild nehme (oder aus der Bibliothek auswählen) mit PhoneGap API mit dem folgende drictive:Lade den Inhalt des Bildes von der Kamera in eine Datei
MyApp.directive('Camera', function() {
return {
restrict: 'A',
require: 'ngModel',
link: function(scope, elm, attrs, ctrl) {
elm.bind('click', function() {
navigator.camera.getPicture(function (imageURI)
{
scope.$apply(function() {
ctrl.$setViewValue(imageURI);
});
}, function (err) {
ctrl.$setValidity('error', false);
},
//Options => http://docs.phonegap.com/en/2.6.0/cordova_camera_camera.md.html#Camera
{ quality: 50,
destinationType:Camera.DestinationType.FILE_URI
})
});
}
};
});
Welche Rückkehr mir eine URI, das aussieht wie, Ripple Emulator auf Chrom, das ich sehe, diesen URI einzufügen.
blob:http%3A//localhost%3A8080/8e18de30-d049-4ce2-ae88-8500b444581e
Mein Problem wird geladen diesen URI
$scope.updateUserProfile = function (user) {
var myPicfile = $http.get(user.myPicture);
dataService.uploadPicture . . . some code to update the picture to Parse
}
* Hinweis: I cannot use phonegap filetransfer together with parse.com :
Als ich tun, dass ich bekommen:
ich meine Anfrage mache wie :
uploadPicture: Funktion uploadPicture (Benutzer, Rückruf) { var serverUrl = 'https://api.parse.com/1/files/' + user.Nick;
Haben Sie eine Idee, wie Sie den Inhalt des Bildes in eine Datei bekommen, die ich dann problemlos auf Parse.com hochladen kann?
Danke!
prüfen diesen [Speicher Foto auf SD-Karte Captured] (http://stackoverflow.com/questions/14928202/save-image-in-local-storage-phonegap/16648829#16648829) –