文件file
上传原理:
var file = $(event.target)[0].files[i];
var reader = new FileReader();
reader.onload = function ( event ) {
var txt = event.target.result; //base64
document.getElementById("result").src = txt;//将base64赋予src
};
reader.readAsDataURL(file);//传入文件对象