commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Raghuveer" <raghuve...@infotechsw.com>
Subject RE: FileItem.getName() not giving arabic file name which is uploaded
Date Wed, 30 Dec 2009 06:31:47 GMT
By default servers use ISO-8859-1 charset.Convert the value to UTF-8 and
use.



String fieldName = item.getFieldName();
String strValue = item.getString();   
String strValueActual=new String(strValue.getBytes("ISO-8859-1"), "UTF-8");

Regards,
Raghuveer Vellanki
Email : raghuveerv@infotechsw.com

-----Original Message-----
From: Arun Kumar S [mailto:arunkumars@crimsonlogic.co.in] 
Sent: Monday, December 28, 2009 6:49 PM
To: dev@commons.apache.org
Subject: FileItem.getName() not giving arabic file name which is uploaded

Hi All,

 

I am using commons-cileUpload1.2.jar.

FileItem.getName() not giving arabic file name which is uploaded.

I am using the following code to get the file name.

 

Iterator iter = fileItems.iterator();

            while (iter.hasNext()) {

                FileItem item = (FileItem) iter.next();

if(!item.isFormField()){

String fieldName = item.getFieldName();

 String fileName = item.getName();

}

}

 

For English it is working fine. For arabic I am getting junk character like,
E:\???.txt.

Is there any encoding support api which is give arabic file name?

 

Please help on the same.

 

Thanks & Regards.

ARUN KUMAR S

 

 



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


Mime
View raw message