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

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

 

解决方案:

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

替换为:

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

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

You may also like...