查看效果:http://sandbox.runjs.cn/show/tgvbo9nq 本地图片转Base64(从而可以预览图片): function localImgLoad() { var src = this.files[0]; var self = $(this); var read = new FileReader(); read.onload = function(e) { var html = "<img src=" + e.target.result + "
package com.education.util; import sun.misc.BASE64Decoder; import sun.misc.BASE64Encoder; import java.io.*; /** * Created by jn-dinggao on 2016/2/4. */ public class Base64Util { // 将图片文件转化为字节数组字符串,并对其进行Base64编码处理 public static String GetImageStr(Stri