经调试,加号是由于文件名末尾有空格引起的
public String getFileName() {
try { this.fileName=fileName.trim();//解决文件名多了加号("+")
this.fileName=java.net.URLEncoder.encode(fileName, "UTF-8");//这句很重要,不然文件名为乱码
} catch (UnsupportedEncodingException e) {
e.printStackTrace();
}
return fileName; }