Dear Sir,
Thanks all team for good support me.
I have one question. I am downloading the file from FTP around 2 GB file. The file is downloading successfully within 8 Minutes or depends on internet speed but i want to create dynamic download file path such as browser download the file by default system download folder.
How to download file by default system download folder
FtpWebResponse response = (FtpWebResponse)request.GetResponse();
Stream responseStream = response.GetResponseStream();
FileStream file = File.Create(@"c:\temp\"+ fname);
FtpWebRequest request = (FtpWebRequest)WebRequest.Create("ftp://ftp01/temp.exe");
request.Method = WebRequestMethods.Ftp.DownloadFile;
request.Credentials = new NetworkCredential("admin", "1234");
FtpWebResponse response = (FtpWebResponse)request.GetResponse();
Stream responseStream = response.GetResponseStream();
FileStream file = File.Create(@"c:\temp\temp.exe");
byte[] buffer = new byte[32 * 1024];
int read;
while ((read = responseStream.Read(buffer, 0, buffer.Length)) > 0)
{
file.Write(buffer, 0, read);
}
file.Close();
responseStream.Close();
response.Close();