P
Parrot
I am trying to download a file from a Unix server to my Windows platform and
the file is not being downloaded. My code is shown below:
FtpWebRequest request = (FtpWebRequest)WebRequest.Create(ftpsite);
request.AuthenticationLevel = System.Net.Security.AuthenticationLevel.None;
request.Credentials = new NetworkCredential(UserID, UserPassword);
request.Method = WebRequestMethods.Ftp.DownloadFile;
FtpWebResponse response = (FtpWebResponse)request.GetResponse();
Message.Text = response.StatusDescription;
response.Close();
The variable ftpsite is set to an ftp address such as
"ftp://ftp.myserver/myfile.dat"
When in debug mode I get the response " 125 Data connection already open -
transfer starting".
Do I have to do some kind of timing operation to keep examining the response
to see if I get a download complete message before I close the response? It
appears that if I go right on through the process without stopping, the
download will not finish. Can anyone see any errors in my coding?
the file is not being downloaded. My code is shown below:
FtpWebRequest request = (FtpWebRequest)WebRequest.Create(ftpsite);
request.AuthenticationLevel = System.Net.Security.AuthenticationLevel.None;
request.Credentials = new NetworkCredential(UserID, UserPassword);
request.Method = WebRequestMethods.Ftp.DownloadFile;
FtpWebResponse response = (FtpWebResponse)request.GetResponse();
Message.Text = response.StatusDescription;
response.Close();
The variable ftpsite is set to an ftp address such as
"ftp://ftp.myserver/myfile.dat"
When in debug mode I get the response " 125 Data connection already open -
transfer starting".
Do I have to do some kind of timing operation to keep examining the response
to see if I get a download complete message before I close the response? It
appears that if I go right on through the process without stopping, the
download will not finish. Can anyone see any errors in my coding?