Discuss (FTP), (FTP on .NET CF) and (FTPS, SFTP and SCP).
no avatar
User

solar01

Posts

2

Joined

Thu Jan 07, 2010 6:59 pm

Send files with special characters (cyrillic, chinese...)

by solar01 » Thu Jan 07, 2010 7:33 pm

Hi,

I'm using edt free version.

I'm in trouble to upload files when filename (only filename) containing special characters as cyrillic characters.

Here is my code :

FTPClient instanciation :

// Instanciation
FTPClient ftpClient = new FTPClient();
// FTP port
ftpClient.ControlPort = port;
// FTP Host
ftpClient.RemoteHost = host;
// Connection Mode
ftpClient.ConnectMode = FTPConnectMode.PASV;
// Control Encoding
ftpClient.ControlEncoding = System.Text.Encoding.GetEncoding("ISO-8859-1");
//Connection
ftpClient.Connect();
//Login
ftpClient.Login(userName, userPwd);
ftpClient.TransferType = FTPTransferType.BINARY;

File upload :

ftpClient.Put(filePath, remoteFileName);

This code works fine when the filename contains only european characters (special characters like ? ? ? ?... are ok).

The problem happens when the filename contains cyrillic characters like пфФЦцчшщ.txt.

I tried with different encodings:
With ISO-8859-1 encoding : the file is not transfered (error : ???????.txt invalid synthax)
WIth ISO-8859-5 encoding : the file is transfered but remote name is ????????.txt
With UTF-8 connection is impossible (error 'USER EU\ftpuser': command not understood (code=500), the debugger displays a square before USER as if there is a special character at the begining...)

Any ideas?

Thanks in advance...
no avatar
User

support2

Posts

3987

Joined

Tue May 18, 2004 8:30 am

Re: Send files with special characters (cyrillic, chinese...

by support2 » Tue Jan 12, 2010 8:48 pm

Does any client succeed in doing this?
no avatar
User

solar01

Posts

2

Joined

Thu Jan 07, 2010 6:59 pm

by solar01 » Tue Jan 12, 2010 9:01 pm

Hi,

No client succeed in send files with cyrillic characters in the filename.

However, I change the ftp server to use utf8 compliant ftp server and it works!
Previously i used IIS 6 (impossible to send my files with cyrillic characters in the filename), now i use FileZilla, i have tested with cyrillic and chinese characters after specifying ControlEncoding as Utf8 (with bom) , and it seems to be ok!

Who is online

Users browsing this forum: No registered users and 43 guests

Powered by phpBB ® | phpBB3 Style by KomiDesign
cron