title: How to Download Zip file from Ftp in C#
body: <p>I have to download zip file from ftp using c# code. 
  i have used the following code.</p>
  
  <pre><code>        Uri url = new Uri("ftp://ftpurl");
          if (url.Scheme == Uri.UriSchemeFtp)
          {
  
              FtpWebRequest objRequest = (FtpWebRequest)FtpWebRequest.Create(url);
              //Set credentials if required else comment this Credential code
              NetworkCredential objCredential = new NetworkCredential(userid, Pwd);
              objRequest.Credentials = objCredential;
              objRequest.Method = WebRequestMethods.Ftp.DownloadFile;
  
              FtpWebResponse objResponse = (FtpWebResponse)objRequest.GetResponse();
  
              StreamReader objReader = new StreamReader(objResponse.GetResponseStream());
              byte[] buffer = new byte[16 * 1024];
              int len = 0;
              FileStream objFS = new FileStream(@"E:\ftpwrite", FileMode.Create, FileAccess.Write, FileShare.Read);
              while ((len = objReader.BaseStream.Read(buffer, 0, buffer.Length)) != 0)
              {
                  objFS.Write(buffer, 0, len);
              }
              objFS.Close();
              objResponse.Close();
  
          }
  </code></pre>
  
  <p>but this code is not giving me the correct response as i want to save file from ftp and this code is writing the data from file  in bytes to my file.
  my file is a zip file not a text file.
  please help me what should i have to do or i am mistunderstanding.</p>