DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=24670>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=24670

File name is not decoded properly when character encoding is different than on 
application server

           Summary: File name is not decoded properly when character
                    encoding is different than on application server
           Product: Struts
           Version: 1.1 Final
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: Major
          Priority: Other
         Component: File Upload
        AssignedTo: [EMAIL PROTECTED]
        ReportedBy: [EMAIL PROTECTED]


If encoding in your browser is different than encoding on your application 
server file name will be decoded incorect.

  For example, if you are using UTF-8 as encoding in your application your 
browser will encode all form fields values as UTF-8. And if you set a UTF-8
in request as request.setCharacterEncoding("UFT-8"), using a filter, Struts 
will handle everything correctly except for the file upload.

  Class org.apache.struts.upload.CommonsMultipartRequestHandler will not use
character encoding from request (if it is available) for file, event if it use 
it for multipart text values (see method addTextParameter(HttpServletRequest 
request, FileItem item)).

  Solution for this problem, unless I'm missing something (which can be true 
also) is to change a method handleRequest(HttpServletRequest request):

        if (request.getCharacterEncoding() != null ) {
            upload.setHeaderEncoding(request.getCharacterEncoding());
        }

  Of course provided character encoding must be supported, but this is idea.


 The problem is browser will encode a file correctly but even if using the 
filter you set proper
 request encoding to UTF-8 Struts will not use it, not for the file name. So 
you was right.

  If I changed CommonsMultipartRequestHandler to use 
request.getCharacterEncoding () that will work
 as should, but not in any other case.

  Am I missing something? Did you find something else after your last post?

  Thank you!

  Kind regards,

  Srdjan

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to