I just keep spinning in circles on this one.
I am able to download files, navigate the directory structure on the ftp server and check if the file I want to upload exists. All without error.
However, now matter how I approach trying to upload (static FtpClient or instance new FtpClient())
I get the same non-descriptive "parameter is incorrect" error upon calling OpenWrite. There is no inner exception.
I realize that this is not a problem with the library since everyone else is able to use it.
I would really appreciate any suggestions you may have though.
conn.Host = "QaFtp";
conn.Port = 21; //990;
conn.Credentials = new NetworkCredential("QaFtp|ftptest", "C()mm()n");
using (Stream s = conn.OpenWrite( "ftp://<IIsFTPServer>/My Dir/MySubDir/test.txt") )
// write data to the file on the server
const int buffer = 2048;
byte contentRead = new byte[buffer];
FileInfo fi = new FileInfo("C:\test.text");
using (FileStream fs = fi.OpenRead())
bytesRead = fs.Read(contentRead, 0, buffer);
s.Write(contentRead, 0, bytesRead);
} while (!(bytesRead < buffer));