<form method="post" action="<%=path%>/application/upload" enctype="multipart/form-data" id="myfile">
<input type="file" name="file">
<input type="submit" value="上传">
</form>
后端
//安装包上传2
public void upload() {
try {
UploadFile upfile = getFile();//JFinal规定getFile()必须最先执行
Ret resJson = Ret.create();
if(upfile==null){
resJson.set("status",0);
resJson.set("message","当前未选择文件");
renderJson(resJson);
return;
}
File file = upfile.getFile();
String filename = file.getName();
//String newfilename =filename.substring(filename.lastIndexOf(