vue for the framework.
it needs to be compressed before uploading. The canva is used to compress before uploading, but the ios11 image cannot be uploaded. After that, I found a plug-in, localResizeIMG.
think2011/localResizeIMG
the results are normal on Android as well as ios9 and 10 tests. Pictures still cannot be uploaded under ios11. You can print out the base64, and the converted blob.
the base64, used to display pictures in the foreground is transmitted to the background by blob.
at first thought it was the reason for the ios11 image format HEIC, then tested it with a png image format. Still not.
what is displayed at the front desk of rst.base64 can be displayed normally.
rst.file, is sent to the background and can be printed in blob format
lrz(file[i])
.then(function(rst) {
//
var img = new Image();
img.src = rst.base64;
console.log(rst.base64)
img.onload = function() {
vm.images.push(rst.base64);
vm.fourimages.push(rst.file)
}
console.log(rst.formData)
console.log(rst.file)
if(vm.images.length > 6) {
vm.images.length = 6;
vm.$dialog.toast({
mes: "6",
timeout: 1500,
icon: "error",
});
}
})
.catch(functerr) {
//
})
.always(function() {
//
});
let formData = new FormData()
for(var l = 0; l < this.$store.state.images.length; lPP) {
formData.append("images[]", this.$store.state.images[l], "img" + [l] + ".jpeg");
}
let config = {
headers: {
"Content-Type": "multipart/form-data"
}
}
this.$http.post(url, formData, config).then(function(res) {
if(res.status === 200) {
this.$dialog.loading.close();
this.$dialog.toast({
mes: res.body.info,
timeout: 1500,
icon: "success"
});
this.$router.push({
path: "/"
})
}
})