イオンとngCordovaカメラプラグインを使用してカメラを起動し、画像をbase64で取得していますが、画像を保存する必要はありません。 base64としてではなく、提供する私はファイルとしてそれを送る必要があります。私のバックアップC#を提供するファイルとしてイメージを送信する方法はありますか?画像をイオンサーバーでファイルに送信する方法
は、これは私のapp.js iがbase64で値を持っています私の画像データで
$scope.takePicture = function(){
var options = {
quality: 50,
destinationType: Camera.DestinationType.DATA_URL,
sourceType: Camera.PictureSourceType.CAMERA,
allowEdit: true,
encodingType: Camera.EncodingType.JPEG,
targetWidth: 250,
targetHeight: 250,
popoverOptions: CameraPopoverOptions,
saveToPhotoAlbum: false,
correctOrientation:true
};
$cordovaCamera.getPicture(options).then(function(imageData) {
console.log(imageData);
$scope.imgURI = "data:image/jpeg;base64," + imageData;
}, function(err) {
// error
});
};
}, false);
ファイル
<img ng-show="imgURI !== undefined" ng-src="{{imgURI}}">
<img ng-show="imgURI === undefined" ng-src="http://placehold.it/250x250">
<button class="button" ng-click="takePicture()">Take Picture</button>
ように私のhtmlファイルに$ scope.imgURIを変換する方法があるに見えています私は自分のイメージを提供して奉仕することができます。
はいあなたは右の私は、そのオプションを見ましたが、この** $ cordovaCamera.getPicture(オプションを使用した後にされています)var image = document.getElementById( 'myImage'); image.src = imageURI; }、**私はこの中に私のファイルがあるサーバーをどこに送るのかわかりません –
私はイオンに慣れていません –
'Camera.DestinationType.FILE_URI'を' imageURI'で使用するとbase64形式の画像の内容が得られます。そこには、base64データとサーバーURLを渡すangle-base64-uploadモジュールを呼び出す必要があります。 – MarcoS