使用 FileReader 对象的方法 var reader = new FileReader(); reader.readAsDataURL(file); 另外给你推荐我的一篇文章:Base64原理解析
https://github.com/chenyinkai...