tapestry-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 25611] New: - Upload Encoding Problem(In DefaultMultipartDecoder)
Date Thu, 18 Dec 2003 05:30:22 GMT
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=25611>.
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=25611

Upload Encoding Problem(In DefaultMultipartDecoder)

           Summary: Upload Encoding Problem(In DefaultMultipartDecoder)
           Product: Tapestry
           Version: 3.0
          Platform: Other
        OS/Version: Other
            Status: NEW
          Severity: Normal
          Priority: Other
         Component: Framework
        AssignedTo: tapestry-dev@jakarta.apache.org
        ReportedBy: erazor_kwan@hotmail.com


When upload a file which name has a different encoding than ISO-8859-1,
the upload component can not get the correct filename.

The problem was caused by the following reason:
In the decode method of DefaultMultipartDecoder

    public void decode(HttpServletRequest request)
    {
        Map partMap = new HashMap();

        request.setAttribute(PART_MAP_ATTRIBUTE_NAME, partMap);
        String encoding = request.getCharacterEncoding();

        DiskFileUpload upload = new DiskFileUpload();

        try
        {
            parts = upload.parseRequest(request, _thresholdSize, _maxSize, 
_repositoryPath);
        }
....

just before the upload.parseRequest, we need to add the following line:
    upload.setHeaderEncoding(encoding);
that will be
        try
        {
            upload.setHeaderEncoding(encoding);
            parts = upload.parseRequest(request, _thresholdSize, _maxSize, 
_repositoryPath);
        }


otherwise, the the request header will be parsed using the ISO-8859-1 
encoding, which caused this problem.

---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-dev-help@jakarta.apache.org


Mime
View raw message