base64格式上传图片方法
作者:互联网
function dataURItoBlob(dataURI) {
const byteString = atob(dataURI.split(',')[1]);
const mimeString = dataURI.split(',')[0].split(':')[1].split(';')[0];
const ab = new ArrayBuffer(byteString.length);
const ia = new Uint8Array(ab);
for (let i = 0;i < byteString.length; i++) {
ia[i] = byteString.charCodeAt(i);
}
return new Blob([ab], {type: mimeString})
}
function uploadImgInfo(item) {
alert("获取uploadImgInfo方法成功.")
var base64Image = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGwAAABsCAYAAACPZlfNAAAACXBIWXMAABcSAAAXEgFnn9JSAAAgAElEQVR4nM19ebAdV3nn7zvdffe37096WixbsizbYzRGxjaLF8JiJuCEsWCACZAUYUhqkgkVAhWm6qGkApVKQggQwFDGJsNMJlImgSI4gINt4h3Lu2wLSbb0nvSkt+/33aW7zzd/nLv0crrvvU9PMqfqSd2nz/nOd77f+ZazdF/CL3ligDA6Sth2U6LgpHtNYEC6so8FDULSdhCPEPEgAz2CRIdkToBlCkRMEkUG2wzMC6JZgKdY0rggPskwplwuzWYETZ4orc5fOveETQcOyNe6v40SvdYMRKUjowcTw8OXpHPC2S2ZX8/ga0HYThBDYB4AURZgAQ7X5Wqm5lklXxJ4mcHTzDhLzK8A+LkEnlpbmT/W27mpSB+/1r5QfTuf9EsDGB9kAzMPpu1UZgdLXEHArZLdG5loK4EsAEalpOI5CqgokACAtQ9VpoQLwSViPiGZHwXjfsPASwsrhbGBny8V6dB+93z6t1HpNQeMRx8wVwcT3ZZB+yTx2wwYb2LiSwBqA3v5Cwg7dBsDFmsq+LLYn0dgZl4k0AnB/IB0cZ+9mnim7ZmxxdcauNcEMAYIf/FcJt+2fKkpjF+BELex5NeToBQAow5UPEgqawOB0tN2GMgD9Igh+YdlOPe32ckx+uQNhbg+Xqh00QHj0QdS5cHEpdIU/1mA3s7ga0CUUg99JQMVg7cN/ZT+YRNgRQ0CYl4F6DCD7xUuf+/E/NTYlQf2lyM4uCDpogHGX743WU5375KQ7yG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NHDTF0MpAAYTMzEcAVQYPA8GPMk6JyUdJrhvmpIHpeSpg0uT3WkMH1o7AfFOw4dkvQa+KVW0v8Ha4jhN9U50kwAAAAASUVORK5CYII='
var fd = new FormData()
var a = this.dataURItoBlob(base64Image);
fd.append('images', a, 'test.jpg')
axios.post(`http://fangwuxiushan.cmcc.f-ui.cn/pad/api/upload/image`,fd,{
headers:{'Content-Type':'multipart/form-data'}
}).then(response => {
alert('上传图片成功')
console.log(response)
app.uploadImgSuccess(response)
})
// document.getElementById("ceshi").innerHTML = cs
}
标签:dataURI,const,base64,fd,split,new,格式,byteString,上传 来源: https://www.cnblogs.com/boreguo/p/14950689.html