You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@commons.apache.org by Arun Kumar S <ar...@crimsonlogic.co.in> on 2009/12/28 14:19:15 UTC

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

 

 


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

Posted by Raghuveer <ra...@infotechsw.com>.
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: user-unsubscribe@commons.apache.org
For additional commands, e-mail: user-help@commons.apache.org


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

Posted by Raghuveer <ra...@infotechsw.com>.
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