我在下载日本文件名的文件时遇到问题。我已经将字符编码设置为utf-8。它可以与本地tomcat一起工作,但不能在ec2服务器上工作。ie和firefox在下载文件时出现问题。chrome浏览器工作正常。
fileName = URLEncoder.encode(fileName,"UTF-8");
modRewriteFileName = URLEncoder.encode(modRewriteFileName,"UTF-8");
URL url = new URL(fileURL + modRewriteFileName);
inputStream = url.openConnection().getInputStream();
从ie浏览器下载文件时出现此错误
java.lang.IllegalArgumentException: Invalid character found in the request target. The valid characters are defined in RFC 7230 and RFC 3986
org.apache.coyote.http11.Http11InputBuffer.parseRequestLine(Http11InputBuffer.java:483)
org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:502)
org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:65)
org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:818)
org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1623)
org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
暂无答案!
目前还没有任何答案,快来回答吧!