You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by Robert Priest <Ro...@bentley.com> on 2004/01/30 21:01:06 UTC

RE: [fileupload] FileItem.getFieldName() does not follow specifie d en coding?

Okay. I re-tract my current this question. It was the client not encoding 
"name" attribute of the input field. It was not the fileupload package at
all.

My apologies to the fileupload team.

-----Original Message-----
From: Robert Priest 
Sent: Thursday, January 29, 2004 4:16 PM
To: 'Jakarta Commons Developers List'
Subject: RE: [fileupload] FileItem.getFieldName() does not follow
specifie d en coding?


I am using the latest version of the fileupload jar
(commons-fileupload-1.0.jar)

-----Original Message-----
From: Robert Priest 
Sent: Thursday, January 29, 2004 2:53 PM
To: 'Jakarta Commons Developers List'
Subject: [fileupload] FileItem.getFieldName() does not follow specified
en coding?


Hello,


I am using DiskFileUpload and the DefaultFileItem classes.

I am setting the Header Encoding (in my jsp page) as so:


    // Create a new file upload handler
    DiskFileUpload upload = new DiskFileUpload();

    //set the encoding to UTF-8
    upload.setHeaderEncoding("UTF-8");



I am attempting to upload a file with Chinese characters in the name.


But when I do a FileItem.getFieldName(), I am coming up with ???? for the
file name.


However, FileItem.getName() seems to be correctly encoded?

Can anyone tell me what I could be missing when I perform a
"getFieldName()".

I know that you can get the contents of a item by specifying
FileItem.getString("UTF-8"), and that will decode correctly. However, there
is no such call for getFieldName().



Thanks in advance.

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

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

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