CI_FTP::close()

close() Returns: TRUE on success, FALSE on failure Return type: bool Closes the connection to your server. It’s recommended that you use this when you are finished uploading.

CI_FTP::list_files()

list_files([$path = '.']) Parameters: $path (string) – Directory path Returns: An array list of files or FALSE on failure Return type: array Permits you to retrieve a list of files on your server returned as an array. You must supply the path to the desired directory. $list = $this->ftp->list_files('/public_html/'); print_r($list);

CI_FTP::connect()

connect([$config = array()]) Parameters: $config (array) – Connection values Returns: TRUE on success, FALSE on failure Return type: bool Connects and logs into to the FTP server. Connection preferences are set by passing an array to the function, or you can store them in a config file. Here is an example showing how you set preferences manually: $this->load->library('ftp'); $config['hostname'] = 'ftp.example.com'; $config['username'] = 'your-username'; $config['password'] =

CI_FTP::download()

download($rempath, $locpath[, $mode = 'auto']) Parameters: $rempath (string) – Remote file path $locpath (string) – Local file path $mode (string) – FTP mode, defaults to ‘auto’ (options are: ‘auto’, ‘binary’, ‘ascii’) Returns: TRUE on success, FALSE on failure Return type: bool Downloads a file from your server. You must supply the remote path and the local path, and you can optionally set the mode. Example: $this->ftp->download('/public_html/myfile.html', '/local/path/to/m

CI_FTP::delete_file()

delete_file($filepath) Parameters: $filepath (string) – Path to file to delete Returns: TRUE on success, FALSE on failure Return type: bool Lets you delete a file. Supply the source path with the file name. $this->ftp->delete_file('/public_html/joe/blog.html');

CI_FTP::chmod()

chmod($path, $perm) Parameters: $path (string) – Path to alter permissions for $perm (int) – Permissions (octal) Returns: TRUE on success, FALSE on failure Return type: bool Permits you to set file permissions. Supply the path to the file or directory you wish to alter permissions on: // Chmod "bar" to 755 $this->ftp->chmod('/public_html/foo/bar/', 0755);

CI_FTP::delete_dir()

delete_dir($filepath) Parameters: $filepath (string) – Path to directory to delete Returns: TRUE on success, FALSE on failure Return type: bool Lets you delete a directory and everything it contains. Supply the source path to the directory with a trailing slash. Important Be VERY careful with this method! It will recursively delete everything within the supplied path, including sub-folders and all files. Make absolutely sure your path is correct. Try using list_files() first to ver

CI_Form_validation::set_rules()

set_rules($field[, $label = ''[, $rules = '']]) Parameters: $field (string) – Field name $label (string) – Field label $rules (mixed) – Validation rules, as a string list separated by a pipe “|”, or as an array or rules Returns: CI_Form_validation instance (method chaining) Return type: CI_Form_validation Permits you to set validation rules, as described in the tutorial sections above: Setting Validation Rules Saving Sets of Validation Rules to a Config File

CI_FTP::changedir()

changedir($path[, $suppress_debug = FALSE]) Parameters: $path (string) – Directory path $suppress_debug (bool) – Whether to turn off debug messages for this command Returns: TRUE on success, FALSE on failure Return type: bool Changes the current working directory to the specified path. The $suppress_debug parameter is useful in case you want to use this method as an is_dir() alternative for FTP.

CI_Form_validation::set_data()

set_data($data) Parameters: $data (array) – Array of data validate Returns: CI_Form_validation instance (method chaining) Return type: CI_Form_validation Permits you to set an array for validation, instead of using the default $_POST array.