encodeURIComponent in velocity template file

Thank you for visiting.

I try to upload a file with URI ‘localhost:8080/jira/plugins/servlet/uploadFile?fileName=’+$fileName.

File to be uploaded with the name ‘first+question+report.txt’ is received by method request.getParameter(“fileName”), but the file name truns to be ‘first question report.txt’ in the servlet.

Finally I resolved the problem by changing the URI to ‘localhost:8080/jira/plugins/servlet/uploadFile?fileName=’+encodeURIComponent($fileName)’. And there are many URIs to be changed.

Is there any other simple way to solve the problem?