FTPWebRequest Fails on Some FTP Sites

  • Thread starter Thread starter Frank Walker
  • Start date Start date
F

Frank Walker

I posted this problem a week ago, and received no response, so here it is
again...

While using FTPWebRequest, I have found at least one FTP site where this
function fails.
The URI I am using is ftp://nssdca.gsfc.nasa.gov/md_doc/app_a.doc

This NASA ftp site is available through anonymous log in, and other FTP
clients, including Internet Explorer using FTP protocols, download the file
just fine.

As the capture below shows, when FTPWebRequest sends PWD, it receives
ANON_DIR:[000000] from the ftp site.

Then when FTPWebRequest sends CWD ANON_DIR:[000000]/md_doc/ it receives an
error of 550, then it gives up and closes the connection.

Any advice on this would be helpful.

Thanks,

Frank Walker



No. Time Source Destination Protocol Info
656 127.450368 130.14.60.135 128.183.241.14 TCP
2888 > ftp [SYN] Seq=0 Ack=0 Win=65535 Len=0 MSS=1460

659 127.454361 130.14.60.135 128.183.241.14 TCP
2888 > ftp [ACK] Seq=1 Ack=1 Win=65535 Len=0

660 127.459681 128.183.241.14 130.14.60.135 FTP
Response: 220 ndadsb.gsfc.nasa.gov MultiNet FTP Server Process V4.2(16) at
Tue 14-Feb-2006 9:10AM-EST

661 127.459876 130.14.60.135 128.183.241.14 FTP
Request: USER anonymous

662 127.527600 128.183.241.14 130.14.60.135 FTP
Response: 331 anonymous user ok. Send real ident as password.

663 127.527751 130.14.60.135 128.183.241.14 FTP
Request: PASS MYUSER@

670 128.539245 128.183.241.14 130.14.60.135 FTP
Response: 230-Guest User MYUSER@ logged into ANON_DIR:[000000] at Tue
14-Feb-2006 9:10AM-EST, job 4280ad34.

674 128.690469 128.183.241.14 130.14.60.135 FTP
Response: 230 Directory and access restrictions apply

675 128.690726 130.14.60.135 128.183.241.14 FTP
Request: PWD

676 128.695622 128.183.241.14 130.14.60.135 FTP
Response: 257 "ANON_DIR:[000000]" is current directory.

677 128.695731 130.14.60.135 128.183.241.14 FTP
Request: CWD ANON_DIR:[000000]/md_doc/

678 128.702017 128.183.241.14 130.14.60.135 FTP
Response: 550 %RMS-F-SYN, file specification syntax error:
ANON_DIR:[000000]/md_doc/

679 128.705557 130.14.60.135 128.183.241.14 TCP
2888 > ftp [FIN, ACK] Seq=67 Ack=414 Win=65122 Len=0
 
I have no helpful advice for using the free FTPWebRequest class from
Microsoft, but I can sure tell you that if you use a 3rd party tool
(such as ours) that this works without any problems.

The C# code to fetch "app_a.doc" from that FTP server is:

Xceed.Ftp.FtpClient client = new Xceed.Ftp.FtpClient();

client.Connect("nssdca.gsfc.nasa.gov");
client.Login(); // Anonymous
client.ChangeCurrentFolder("md_doc");

client.ReceiveFile("app_a.doc", @"d:\app_a.doc");

Voila!

Our product, Xceed FTP for .NET product is:

http://www.xceedsoft.com/products/ftpnet

Hope this helps.

I posted this problem a week ago, and received no response, so here it is
again...

While using FTPWebRequest, I have found at least one FTP site where this
function fails.
The URI I am using is ftp://nssdca.gsfc.nasa.gov/md_doc/app_a.doc

This NASA ftp site is available through anonymous log in, and other FTP
clients, including Internet Explorer using FTP protocols, download the file
just fine.

As the capture below shows, when FTPWebRequest sends PWD, it receives
ANON_DIR:[000000] from the ftp site.

Then when FTPWebRequest sends CWD ANON_DIR:[000000]/md_doc/ it receives an
error of 550, then it gives up and closes the connection.

Any advice on this would be helpful.

Thanks,

Frank Walker



No. Time Source Destination Protocol Info
656 127.450368 130.14.60.135 128.183.241.14 TCP
2888 > ftp [SYN] Seq=0 Ack=0 Win=65535 Len=0 MSS=1460

659 127.454361 130.14.60.135 128.183.241.14 TCP
2888 > ftp [ACK] Seq=1 Ack=1 Win=65535 Len=0

660 127.459681 128.183.241.14 130.14.60.135 FTP
Response: 220 ndadsb.gsfc.nasa.gov MultiNet FTP Server Process V4.2(16) at
Tue 14-Feb-2006 9:10AM-EST

661 127.459876 130.14.60.135 128.183.241.14 FTP
Request: USER anonymous

662 127.527600 128.183.241.14 130.14.60.135 FTP
Response: 331 anonymous user ok. Send real ident as password.

663 127.527751 130.14.60.135 128.183.241.14 FTP
Request: PASS MYUSER@

670 128.539245 128.183.241.14 130.14.60.135 FTP
Response: 230-Guest User MYUSER@ logged into ANON_DIR:[000000] at Tue
14-Feb-2006 9:10AM-EST, job 4280ad34.

674 128.690469 128.183.241.14 130.14.60.135 FTP
Response: 230 Directory and access restrictions apply

675 128.690726 130.14.60.135 128.183.241.14 FTP
Request: PWD

676 128.695622 128.183.241.14 130.14.60.135 FTP
Response: 257 "ANON_DIR:[000000]" is current directory.

677 128.695731 130.14.60.135 128.183.241.14 FTP
Request: CWD ANON_DIR:[000000]/md_doc/

678 128.702017 128.183.241.14 130.14.60.135 FTP
Response: 550 %RMS-F-SYN, file specification syntax error:
ANON_DIR:[000000]/md_doc/

679 128.705557 130.14.60.135 128.183.241.14 TCP
2888 > ftp [FIN, ACK] Seq=67 Ack=414 Win=65122 Len=0

--
Alex Leblanc
Xceed Software Inc.
http://www.xceedsoft.com

Check out our advanced .NET zip file and compression library

Email: (e-mail address removed) (remove the first 'x')
 
Hi Frank,

The URI is a URI to an anonymously-available document (I just clikced on the
URI to get it). Why would you then send a CWD command?

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
To a tea you esteem
a hurting back as a wallet.
 
Kevin,

That's the question I have: why is FTPWebRequest doing this?
I think the person who designed this function may not have tested
it on many FTP sites. Internet Explorer certainly doesn't have this problem.

Once logged into the FTP site, IE issues a RETR /md_doc/app_a.doc ,
and avoids the problem with CWD.

Frank Walker

Kevin Spencer said:
Hi Frank,

The URI is a URI to an anonymously-available document (I just clikced on
the URI to get it). Why would you then send a CWD command?

--
HTH,

Kevin Spencer
Microsoft MVP
.Net Developer
To a tea you esteem
a hurting back as a wallet.


Frank Walker said:
I posted this problem a week ago, and received no response, so here it is
again...

While using FTPWebRequest, I have found at least one FTP site where this
function fails.
The URI I am using is ftp://nssdca.gsfc.nasa.gov/md_doc/app_a.doc

This NASA ftp site is available through anonymous log in, and other FTP
clients, including Internet Explorer using FTP protocols, download the
file just fine.

As the capture below shows, when FTPWebRequest sends PWD, it receives
ANON_DIR:[000000] from the ftp site.

Then when FTPWebRequest sends CWD ANON_DIR:[000000]/md_doc/ it receives
an
error of 550, then it gives up and closes the connection.

Any advice on this would be helpful.

Thanks,

Frank Walker



No. Time Source Destination Protocol Info
656 127.450368 130.14.60.135 128.183.241.14 TCP
2888 > ftp [SYN] Seq=0 Ack=0 Win=65535 Len=0 MSS=1460

659 127.454361 130.14.60.135 128.183.241.14 TCP
2888 > ftp [ACK] Seq=1 Ack=1 Win=65535 Len=0

660 127.459681 128.183.241.14 130.14.60.135 FTP
Response: 220 ndadsb.gsfc.nasa.gov MultiNet FTP Server Process V4.2(16)
at
Tue 14-Feb-2006 9:10AM-EST

661 127.459876 130.14.60.135 128.183.241.14 FTP
Request: USER anonymous

662 127.527600 128.183.241.14 130.14.60.135 FTP
Response: 331 anonymous user ok. Send real ident as password.

663 127.527751 130.14.60.135 128.183.241.14 FTP
Request: PASS MYUSER@

670 128.539245 128.183.241.14 130.14.60.135 FTP
Response: 230-Guest User MYUSER@ logged into ANON_DIR:[000000] at Tue
14-Feb-2006 9:10AM-EST, job 4280ad34.

674 128.690469 128.183.241.14 130.14.60.135 FTP
Response: 230 Directory and access restrictions apply

675 128.690726 130.14.60.135 128.183.241.14 FTP
Request: PWD

676 128.695622 128.183.241.14 130.14.60.135 FTP
Response: 257 "ANON_DIR:[000000]" is current directory.

677 128.695731 130.14.60.135 128.183.241.14 FTP
Request: CWD ANON_DIR:[000000]/md_doc/

678 128.702017 128.183.241.14 130.14.60.135 FTP
Response: 550 %RMS-F-SYN, file specification syntax error:
ANON_DIR:[000000]/md_doc/

679 128.705557 130.14.60.135 128.183.241.14 TCP
2888 > ftp [FIN, ACK] Seq=67 Ack=414 Win=65122 Len=0
 
Back
Top