B
BizWorld
I am using .NET 2.0 new classed for FTP download purpose. I have
requirement to connect with 3 different FTP and download all files
list and see if file exist at my end. if not then i need to download.
I am keeping my configuration in XML file so that i can use my same
code and i simply iterate on my configuration data. 1st FTP connect
works fine but 2nd FTP does not connect and return with following
error message. After this failure when my code attemp to for the 3rd
FTP, it works. but it also fail on Download file for 3rd FTP on some
files. I could not find any specific reason for this exception. If i
make my failing FTP as 1st one, so in general my second FTP request in
my loop fails. i tested 3 ftp in internet explorer and they work fine.
but in .NET 2.0 new classes i can see these un knonw behaviours. any
suggestion on improving code or setting some other property which i am
missing?????????????
The remote server returned an error: (503) Bad sequence of commands.
I further trace the error line, it is coming on following line,
response = reqFTP.GetResponse()
here is my code below which works well for 1st FTP Request but it
fails on 2nd FTP.
reqFTP = System.Net.FtpWebRequest.Create(New Uri("ftp://"
+ Me.FTP_Address))
reqFTP.KeepAlive = True
reqFTP.UseBinary = True
reqFTP.Credentials = New
System.Net.NetworkCredential(Me.FTP_User, Me.FTP_Password)
reqFTP.Method =
System.Net.WebRequestMethods.Ftp.ListDirectory
response = reqFTP.GetResponse()
reader = New
System.IO.StreamReader(response.GetResponseStream())
line = reader.ReadLine()
While (Not line Is Nothing)
result.Append(line)
result.Append(",")
line = reader.ReadLine()
End While
' to remove the trailing ','
result.Remove(result.ToString().LastIndexOf(","), 1)
reader.Close()
It is URGENT for me to resolve this issue, otherwise i will have to
switch to a 3rd Party FTP component. I was excited about 2.0 new
classes and i hope this issue will resolve with some one's feedback.
requirement to connect with 3 different FTP and download all files
list and see if file exist at my end. if not then i need to download.
I am keeping my configuration in XML file so that i can use my same
code and i simply iterate on my configuration data. 1st FTP connect
works fine but 2nd FTP does not connect and return with following
error message. After this failure when my code attemp to for the 3rd
FTP, it works. but it also fail on Download file for 3rd FTP on some
files. I could not find any specific reason for this exception. If i
make my failing FTP as 1st one, so in general my second FTP request in
my loop fails. i tested 3 ftp in internet explorer and they work fine.
but in .NET 2.0 new classes i can see these un knonw behaviours. any
suggestion on improving code or setting some other property which i am
missing?????????????
The remote server returned an error: (503) Bad sequence of commands.
I further trace the error line, it is coming on following line,
response = reqFTP.GetResponse()
here is my code below which works well for 1st FTP Request but it
fails on 2nd FTP.
reqFTP = System.Net.FtpWebRequest.Create(New Uri("ftp://"
+ Me.FTP_Address))
reqFTP.KeepAlive = True
reqFTP.UseBinary = True
reqFTP.Credentials = New
System.Net.NetworkCredential(Me.FTP_User, Me.FTP_Password)
reqFTP.Method =
System.Net.WebRequestMethods.Ftp.ListDirectory
response = reqFTP.GetResponse()
reader = New
System.IO.StreamReader(response.GetResponseStream())
line = reader.ReadLine()
While (Not line Is Nothing)
result.Append(line)
result.Append(",")
line = reader.ReadLine()
End While
' to remove the trailing ','
result.Remove(result.ToString().LastIndexOf(","), 1)
reader.Close()
It is URGENT for me to resolve this issue, otherwise i will have to
switch to a 3rd Party FTP component. I was excited about 2.0 new
classes and i hope this issue will resolve with some one's feedback.