Hello!
I’m using EMX Dev. System. I want to make a FTP client uploading data from sd card to remote server. But when I’m trying to get a request stream from sever, program stops(no exceptions throwed). Here is my code:
string path = "ftp://147.32.200.115:1335/readme.txt";
FtpWebRequest ftpreq = (FtpWebRequest)WebRequest.Create(path);
ftpreq.Method = WebRequestMethods.Ftp.UploadFile;
ftpreq.Credentials = new NetworkCredential( "user","password");
ftpreq.UsePassive = false;
Stream testingsStream = ftpreq.GetRequestStream();// Here the problem begins
FileStream readingStream = new FileStream("SD\\data\\readme.txt", FileMode.OpenOrCreate, FileAccess.ReadWrite);
int readed;
byte[] buff = new byte[4096];
do
{
readed = readingStream.Read(buff, 0, 4096);
testingsStream.Write(buff, 0, readed);
}
while (readed != 0);
readingStream.Dispose();
testingsStream.Dispose();
Any ideas?
P.S.When I changed ftpreq.UsePassive=true NotSupportedException “This version does not support passive mode.” is being thrown. What could it be?