[英]image doesn't send to serveur from ionic3
I try upload multiple images from ionic3 to serveur php but I have error images doesn't send to backend.. I use imagepicker plugin to select multiple images .. 我尝试将多个图像从ionic3上传到serveur php,但是我有错误图像没有发送到后端。.我使用imagepicker插件来选择多个图像..
code angular: 代码角度:
testfile(){
for (var l of this.images)
{
if(l !== 'K' && l !== 'O')
{
this.base64.encodeFile(l).then((base64File: string) => {
var formData = new FormData();
formData.append('photo',base64File);
this.http.post('url api',formData, {responseType: 'text'}).subscribe(res =>
alert(res),
err => {
this.presentToast(err);
});
}
, (err) => {
this.presentToast(err);
this.presentToast('error encode');
});
}
}
}
also I try send base64File without append to formData and also I try send l (get in loop) but also error in all cases 我也尝试发送不附加到formData的base64File,也尝试发送l(循环获取),但在所有情况下都出错
尝试使用相机插件并进行设置
Camera.PictureSourceType: PHOTOLIBRARY
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.