WebRequestMethods.Ftp Problem

  • Thread starter Thread starter Bob Phillips
  • Start date Start date
B

Bob Phillips

Hello All:

I am building a small app that will download files from an FTP server
(SCO Unix). I am told that the filenames may be reused, so I have to
check the file size. However, the WebRequestMethods.Ftp.GetFileSize is
not returning anything from GetResponseStream(). A read of the stream
returns null. Has anybody else seen this behavior?
-Bob
 
Hello All:

I am building a small app that will download files from an FTP server
(SCO Unix). I am told that the filenames may be reused, so I have to
check the file size. However, the WebRequestMethods.Ftp.GetFileSize is
not returning anything from GetResponseStream(). A read of the stream
returns null. Has anybody else seen this behavior?

Are you sure the FTP Server you're talking to supports the SIZE command?
I know it's pretty much implemented by all FTP servers, but I don't
think it's in an RFC yet (its not in the original RFC for the FTP
protocol).

Does it work (and give back valid data) when you connect with a regular
FTP client?
 
Patrick said:
Are you sure the FTP Server you're talking to supports the SIZE command?
I know it's pretty much implemented by all FTP servers, but I don't
think it's in an RFC yet (its not in the original RFC for the FTP
protocol).

Does it work (and give back valid data) when you connect with a regular
FTP client?

Hi Patrick:
Thanks for the response. I just downloaded CuteFTP and the properties
dialog is showing the correct byte count of the file. I'm assuming
that it gets this via the SIZE command, although I don't know that for
sure.
-Bob
 
Hi Patrick:
Thanks for the response. I just downloaded CuteFTP and the properties
dialog is showing the correct byte count of the file. I'm assuming
that it gets this via the SIZE command, although I don't know that for
sure.

Best way is to use Windows' built-in FTP client. Go to a command prompt
and enter:

ftp [hostname]

Enter your username and password when prompted. Use "CD [dir]" to
change to the appropriate directory. The enter your "SIZE" command and
see what happens.

Or, actually, once you get connected, I think you can help "HELP" or
just "?" and the server will return you a list of commands it supports.

I just tried it on a personal website of mine and I got an invalid
command when I tried to use "SIZE".
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top