File file = new File(localDirPath + fileName);
try{
InputStream in = null;
in = new FileInputStream(file);
int fileLength = in.available();
if(fileLength == 0) {
log.info(文件大小为0KB,请检查。);
}
if(fileLength >4096000) {
log.info(“文件大小不能超过5M”);
}
}catch(IOException e) {
e.printStackTrace();
}
文件上传大小控制
最新推荐文章于 2024-08-05 06:28:15 发布