2019-06-27 16:01
@CliveNo.1 /**
* #文件上传大小限制 10 * 1024 * 1024 = 10M
*/
public static final String config_maxPostSize = "10485760";
/**
* 文件上传根路径
*/
public static final String config_fileUploadRoot = "/img/";
// 上传图片的demo
public void upload() {
StringBuilder savePathStr = new StringBuilder(PathKit.getWebRootPath() + config_fileUploadRoot);
File savePath = new File(savePathStr.toString());
if (!savePath.exists()) {
savePath.mkdirs();
}
String fileRoot = "";
// 保存文件
try {
List files = getFiles(savePath.getPath(), Integer.parseInt(config_maxPostSize), "UTF-8");
fileRoot = config_fileUploadRoot + files.get(0).getFileName();
} catch (Exception e) {
// TODO: handle exception
System.out.println(e);
}
renderJson(fileRoot);
}
2019-06-26 14:20
@l745230 传参数用Map不可以吗,我用Map传进去还是需要判断啊,怎么让他不循环呢