Our Products:   CompleteFTP  edtFTPnet/Free  edtFTPnet/PRO  edtFTPj/Free  edtFTPj/PRO
0 votes
3.8k views
in .NET FTP by (1.5k points)
Hi All

Can anyone give me a pointer on how to get a client to retreive the free hard drive space on teh servers target folder?

Cheers
Malcom

4 Answers

0 votes
by (51.6k points)
That feature is not available in standard FTP, but the specific FTP server that you're using may have a SITE command for it. You will need to find out what the server is and check its documentation.

- Hans (EnterpriseDT)
0 votes
by (1.5k points)
Thanks Hans

I'll do some research on that command

cheers
Malcom
0 votes
by (1.5k points)
Just in case this helps someone else-

As we have a good relationship with the owners of the target ftp server, I talked them into setting up a cron job which writes the free drive space value into a FTP accessible file every so often.
That file has nothing but the text value of the free drive space. I download the file to get the free space value and process accordingly...
0 votes
by (51.6k points)
On that note, I may as well also point out that our server, CompleteFTP Enterprise, allows administrators to add their own SITE commands (see here). This is done by developing a .NET assembly (i.e. DLL) and adding it as an extension (aka plug-in) to CompleteFTP.

The code for the extension would be something like this:
using System.IO;
using EnterpriseDT.Net.FtpServer.Core;

namespace SampleExtensions
{
    public class DriveSpaceCommands: SiteCommands
    {
        [SiteCommandName("ListDriveSpace")]
        public string GetDriveSpace(string drive)
        {
            DriveInfo driveInfo = new DriveInfo(drive);
            return driveInfo.AvailableFreeSpace + " bytes";
        }
    }
}


This would then allow clients to do the following:
ftp> SITE ListDriveSpace D:
200- 909238409234 bytes
200 SITE command successful.
ftp>

Categories

...