Our Products:   CompleteFTP  edtFTPnet/Free  edtFTPnet/PRO  edtFTPj/Free  edtFTPj/PRO
0 votes
3.8k views
in .NET FTP by (400 points)
Hi Support,

We have used edtftpnet free version in our project. When we try to upload a file with the following name "Microsoft

5 Answers

0 votes
by (162k points)
You need to set the control encoding to be something other than ASCII.

Look at CommandEncoding, try setting it to Encoding.GetEncoding("Windows-1252")

Also, your server may not support special characters ...
0 votes
by (260 points)
Hi,

if you work with the FTPClient class, you should try to do this when you instanciate it :
FTPClient ftpClient = new FTPClient();
ftpClient.ControlEncoding = new UTF8Encoding(false);


In fact you need to change the Encoding of the control stream, because its ASCII by default and special caracters like "
0 votes
by (400 points)
Hi Support,

Here is our code:



using System;
using System.IO;
using EnterpriseDT.Net;

class UL
{

/// <summary>
/// The main entry point for the application.
/// </summary>
///

[STAThread]
static void Main(string[] args)
{

EnterpriseDT.Net.Ftp.FTPConnection FtpConn = new EnterpriseDT.Net.Ftp.FTPConnection();

string Source=string.Empty,Destination=string.Empty,FtpAddress=string.Empty,FtpUserName=string.Empty,FtpPwd = string.Empty;
StreamReader sr= new StreamReader("abc.ini");
Source=sr.ReadLine();
FtpAddress = sr.ReadLine();
FtpUserName = sr.ReadLine();
FtpPwd = sr.ReadLine();
Destination =sr.ReadLine();

sr.Close();

FtpConn.UserName = FtpUserName;
FtpConn.Password = FtpPwd;
FtpConn.ServerAddress = FtpAddress;

string Fname = string.Empty;

try
{
FtpConn.Connect();

string[] dir = Directory.GetFiles(Source ,"*.*");
foreach(string s in dir)
{
Fname=s.Substring(s.LastIndexOf("\\"));
FtpConn.UploadFile(s,Destination + Fname);

}
}
catch(EnterpriseDT.Net.Ftp.FTPException e)
{
FtpConn.Close();
}
}


Please let us know where can we use the encoding part in the above mentioned code. Please its very urgent.


Thanks for your kind attention and support.



Many Thanks
Kris
0 votes
by (260 points)
Try this :
[STAThread]
static void Main(string[] args)
{

     EnterpriseDT.Net.Ftp.FTPConnection FtpConn = new EnterpriseDT.Net.Ftp.FTPConnection();
     FtpConn.FilePathEncoding = new UTF8Encoding(false);
     ....
}
0 votes
by (400 points)
thank you very much..

it works..


Many Thanks
Kris

Categories

...