//填充预览图片 function adpter(file, upfile) { var imgName = new Date().getTime() + file.name.substr(file.name.lastIndexOf('.')); if (file) { if (file.type.indexOf('image') == 0) { var reader = new FileReader(); reader.onload = function (e) { var image1 =…
第一种方式 <script type="text/javascript"> function setImagePreview() { var docObj = document.getElementById("ctl00_ContentMain_file_head"); var fileName = docObj.value; if (!fileName.match(/.jpg|.gif|.png|.bmp/i)) { alert('您上传的图片格式不正…