Retrieving filesize information |
You can retrieve the byte size of a file using the GetFileSize method. All filenames are relative to your current remote directory.
Example
[C#]
// get size of file image.gif in bytes
long filesize = myFtp.GetFileSize("image.gif");
[Visual Basic]
' get size of file image.gif in bytes
Dim filesize As Long = myFtp.GetFileSize("image.gif")
Note
The GetFileSize method utilizes a command that is supported by a majority of FTP servers however is not officially recognized by RFC 959 so may not be supported on some FTP servers.
See also