File file; //接收文件
String fileFileName; //获取文件名
public String execute(){
System.out.println(fileFileName.substring(fileFileName.lastIndexof(".")+1));//获取文件的扩展名,可以对上传文件进行类型拦截判断
}
struts2获取文件及获得扩展名
最新推荐文章于 2021-07-31 16:01:53 发布