ftp_connection::create_file

Description

Attempts to create the specified file.

Syntax

bool ftp_connection::create_file (string $ftp_file)



Parameter $ftp_file

Expected type: String
Description: The file to create



Return value

Expected type: Boolean
Description: True if the file was created successfully, false otherwise


Notes

  • Example: $package_ftp->create_file('myfile.txt');
  • Sends the STOR command to the FTP server
  • Checks for a valid connection and returns false if it isn't valid
  • Tries to open a passive connection and returns false if that fails
  • Attempts to establish a connection to the IP and port specified by the passive connection
  • Sets a 'bad_file' error, tries to close the afore-mentioned connection and returns false if the response code isn't 150 (see check_response)
Advertisement: