commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From NBW <email...@gmail.com>
Subject Re: Store file with arabic filename
Date Tue, 23 Feb 2010 20:36:45 GMT
Can your server handle UTF8 file names? Have you tried manually FTPing
to it with a tool like FileZilla or Unix FTP to see if it can?

-Noah

On Tue, Feb 23, 2010 at 11:59 AM, CARROLLE Mathieu
<mathieu.carrolle@petalslink.com> wrote:
> Hi,
> I am sending file with arabic filename on ftp server and it doesn't
> work. Arabic character are replace by ?. I am using the storeFile method.
> Here my code snippet :
>
>        String filename = null;
>
>        filename = "س.xml";//Unicode value: \u0633
>
>        File file = new File(filename);
>
>        InputStream in = null;
>
>        try {
>
>            in = new FileInputStream(file);
>
>            if (in != null) {
>
>                FTPClient client = new FTPClient();
>
>                client.connect("####");
>
>                client.login("####", "#####");
>
>                client.setControlEncoding("UTF-8");
>
>                client.storeFile(filename, in);
>
>                in.close();
>
>            }
>
>        } catch (Exception e) {
>
>            e.printStackTrace();
>
>        }
>
>
> Can anybody help me ?
>
> Thanks.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
> For additional commands, e-mail: user-help@commons.apache.org
>
>

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


Mime
View raw message