FtpWebRequest request = (FtpWebRequest)FtpWebRequest.Create("ftp://192.168.1.119/images"); request.Credentials = new NetworkCredential("Rahul Middha","jkd"); request.Method = WebRequestMethods.Ftp.MakeDirectory; request.UsePassive = true; request.UseBinary = true; request.KeepAlive = false; DirectoryInfo di = new DirectoryInfo("C:\\Datacap\\Demo\\images"); FileInfo[] files=null; if (di.Exists) { files = di.GetFiles("*.TIF"); } FileStream fs = null; int buffLength = 2048; byte[] buff = new byte[buffLength]; foreach (FileInfo fi in files) { fs = fi.OpenRead(); fs.Read(buff, 0, buff.Length); } fs.Close(); Stream reqStream = request.GetRequestStream(); reqStream.Write(buff, 0, buff.Length); reqStream.Close();
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)