ftp_connection::unlink

Description

Deletes the specified file from the server.

Syntax

bool ftp_connection::unlink (string $ftp_file)



Parameter $ftp_file

Expected type: String
Description: The name of the file to delete



Return value

Expected type: Boolean
Description: True if successful, false otherwise


Notes

  • Example: $package_ftp->unlink('myfile.txt');
  • Sends the DELE command to the FTP server
  • Checks for a valid connection before continuing
  • Checks for a 250 response code (Requested file action ok, completed)
  • Sets a 'bad_file' error if the command wasn't successful
  • Returns false if there's no valid connection or the command was unsuccessful
Advertisement: