Hi all,
I'm getting a strange exception when I try to simply put a file a server. Indeed, I've made a simple test ( see below ), and when I call the "put" function I get :
Object reference not set to an instance of an object." System.Exception {System.NullReferenceException}
Some remarks :
_ The local file "E:\Test.zip" is existing
_ I've got all the authorization on the ftp server to put the file
Here is my code :
string sFilePath = "E:\\Test.zip";
string sRemoteFileName = "Test.zip";
FTPClient ftp = new FTPClient();
FileInfo fi = new FileInfo(sFilePath);
FileStream fs = fi.OpenRead();
try
{
ftp.Put(fs, sRemoteFileName, false);
}
catch
{
// I get here the Exception
}
If you have got an idea about the reason I get an NullReferenceException ....
Thanks a lot for your help.
________
Zx14 vs hayabusa