iam devoloping both ftp server and client in c# (windows application) i have two doubts 1. in ftp client when set sslenable=true for security then server receive "AUTH" command server returns "226 authenticated" then server recieve some encoded character. my qustion is what is that chracter and which code returns by server 2.when uploading a file asynchronously server receive "OPTS" command which code returns for this by server please help me with advance thanks
JABIR E
Posts
-
FTP IN C# -
Problem while uploading file on FTP serverfor getting full data without error use binary reader for uploading like this //FtpWebReq.Credentials = new NetworkCredential(userId, Password); // FtpWebReq.Method = WebRequestMethods.Ftp.UploadFile; //FtpWebReq.KeepAlive = false; // FtpWebReq.UseBinary = true; //FtpWebReq.ContentLength = FINFO.Length; FileStream fsSource = new FileStream(fileName, FileMode.Open, FileAccess.Read); BinaryReader binReader = new BinaryReader(fsSource); Stream strm=null; byte[] byteRead; binReader.BaseStream.Seek(0, SeekOrigin.Begin); long pos = 0, fLen = 0; int buffLength = 2048; int readSize = buffLength; fLen = FINFO.Length; try { strm = FtpWebReq.GetRequestStream(); while (binReader.BaseStream.Position < fLen) { pos = binReader.BaseStream.Position; if (fLen - pos < buffLength) readSize = (int)(fLen - pos); byteRead = binReader.ReadBytes(readSize); strm.Write(byteRead, 0, readSize); } binReader.Close(); strm.Close(); fsSource.Close(); }
-
FTPWHEN WE SET FTPWEBREQUEST.SSLENABLE=TRUE FROM CLIENT THEN SERVER RECEIVE "AUTH TLS" THEN SERVER SEND 234 ,AFTER THIS SERVER RECEIVES SOME DATA MY QUSTIONS IS WHAT IS THAT DATA WHAT COMMAND IS REPLY FOR THAT FROM SERVER? WHAT IS THE NEXT PROCESS
-
size of memorystream.toarray()Bitmap BMP = new Bitmap(60, 32); Graphics g; g = Graphics.FromImage(BMP); g.DrawString("abcdef", font, Brushes.Red, new PointF()); MemoryStream mem = new MemoryStream(); BMP.Save(mem,ImageFormat.Bmp); Byte[] B = mem.ToArray(); size of B should be 60*32/8 but i got the size is 7734 can i get exact size pls