Wechat: yu389741| Email: gisdqy@163.com

Shop:https://www.giserdqy.com/shop

下载文件时空格变加号问题


问题:下载文件时文件名有空格时变加号?

 

解决方案:

fileName = URLEncoder.encode(fileName,”UTF-8″);

替换为:

fileName = URLEncoder.encode(fileName,”UTF-8″).replaceAll(“//+”, “%20”);

转载自:https://blog.csdn.net/hfhwfw/article/details/5661379