0
私の目的は、写真を撮り、ajax呼び出しでサーバーbase64に送信することです。私の問題は、サーバーに送信し、ブラウザでテストすると破損していますが、デバイスの表示がうまくいけば、この問題はiOSのアンドロイドでのみ問題あり、base64を送信するとブラウザで開くことができます写真:私はコード2のイオンロボット2プロジェクトを開発しました。サーバーにbase64を送信すると画像が壊れていました。
takePicture(qidSide) {
Camera.getPicture({
destinationType: Camera.DestinationType.DATA_URL,
targetWidth: 1000,
quality: 25,
targetHeight: 700
}).then((imageData) => {
// imageData is a base64 encoded string
if (qidSide == 'front') {
this.QIDfront = this._sanitizer.bypassSecurityTrustUrl("data:image/jpeg;base64,"+imageData);
} else {
this.QIDback = this._sanitizer.bypassSecurityTrustUrl("data:image/jpeg;base64," + imageData);
}
}, (err) => {
console.log(err);
});
}
とサーバーに送信する
var jsonBody = { frontQID: this.QIDfront.changingThisBreaksApplicationSecurity, backQid: this.QIDback.changingThisBreaksApplicationSecurity };
this.xhrService.xhrCall({ method: 'post', url: 'updateSignature', data: jsonBody }).then(data => {
let response: any = data;
}).catch(err => {
});
してくださいすることができます私は3日からこの問題にしていていずれかの助け?