Skip to content

Path Utilities

Robin Rodricks edited this page Jun 14, 2023 · 4 revisions

API

Please import FluentFTP to use these extension methods, or access them directly under the FtpExtensions class.

  • GetFtpPath(path) - Converts the specified local file/directory path into a valid FTP file system path

  • GetFtpPath(path, segments) - Creates a valid FTP path by appending the specified segments to this string

  • GetFtpDirectoryName(path) - Gets the parent directory path of the given file path

  • GetFtpFileName(path) - Gets the file name and extension (if any) from the path

  • GetFtpDate(date, styles) - Tries to convert the string FTP date representation into a date time object

  • FileSizeToString(bytes) - Converts a file size in bytes to a string representation (eg. 12345 becomes 12.3 KB)

  • IsFtpRootDirectory(bytes) - Checks if the given path is a root directory or working directory path.

Please access these static methods directly under the FtpClient class.

  • GetPublicIP() - Use the Ipify service to calculate your public IP. Useful if you are behind a router or don't have a static IP.
Clone this wiki locally