图片预览 @GetMapping("/image") @ResponseBody public Result image(@RequestParam("imageName") String imageName, HttpServletResponse response) { // 判断图片是否存在 int result = HbaseUtil.fileIsExist(Constant.tableName, imageName); if (result == -1)
//上传图片后立即预览 file对象,图片容器id function showImg(fileObj,imgId) { var file=fileObj.files[0]; var r = new FileReader(); r.readAsDataURL(file); $(r).load(function() { $('#'+imgId).attr("src", this.result); }) } <input type="file" onchange=&