1.applyform_add.html
修改身份證件上傳允許格式文字提示內(nèi)容,去掉xls,doc格式
<input type="file" name="zhengj" id="zhengj" /><a style="color:#f00; font-size:12px;">文件格式 png,bmp,jpg</a>
修改前
修改后
2.applyform_add.js
修改身份證件上傳允許格式校驗(yàn),去掉xls,xlsx,doc,docx格式
var str=",jpg,bmp,png,";
修改前
修改后
3.
// LMY 20210512 圖片加水印處理
String filePath = sbRealPath.toString();
//System.out.println(fieldName);
if ("zhengj".equalsIgnoreCase(fieldName) && filePath != null && filePath.contains("/") && filePath.contains(".")){
//System.out.println("filePath:\t" + filePath);
String toFilePath = filePath.substring(0, filePath.lastIndexOf("/"));
//System.out.println("toFilePath:\t" + toFilePath);
String toFileName = filePath.substring(filePath.lastIndexOf("/")+1,filePath.lastIndexOf("."));
//System.out.println("toFileName:\t" + toFileName);
String fileType = filePath.substring(filePath.lastIndexOf(".")+1);
//System.out.println("fileType:\t" + fileType);
if ("bmp".equalsIgnoreCase(fileType) || "jpg".equalsIgnoreCase(fileType) || "png".equalsIgnoreCase(fileType)){
//System.out.println("加水印");
markImageByMoreText(filePath, toFilePath, toFileName, fileType, Color.GRAY, "僅供政府信息公開(kāi)申請(qǐng)使用", -30);
}
}