By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,241 Members | 760 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,241 IT Pros & Developers. It's quick & easy.

WebRequestMethods.Ftp Problem

P: n/a
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

Oct 3 '06 #1
Share this Question
Share on Google+
3 Replies


P: n/a
In article <11**********************@i3g2000cwc.googlegroups. com>,
ph******@bellsouth.net says...
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 Steele
http://weblogs.asp.net/psteele
Oct 5 '06 #2

P: n/a

Patrick Steele wrote:
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 Steele
http://weblogs.asp.net/psteele
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

Oct 5 '06 #3

P: n/a
In article <11**********************@i3g2000cwc.googlegroups. com>,
ph******@bellsouth.net says...
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".

--
Patrick Steele
http://weblogs.asp.net/psteele
Oct 5 '06 #4

This discussion thread is closed

Replies have been disabled for this discussion.