Net_FTP::getRecursive()

Net_FTP::getRecursive() -- download a whole directory to the computer your script runs on.

Synopsis

require_once 'Net/FTP.php';

mixed Net_FTP::getRecursive (string $remote_path, string $local_path [, bool $overwrite = false [, int $mode = null]])

Description

This downloads a whole directory from the FTP server to the computer your script runs on.

Parameter

Return value

mixed - true on success, otherwise PEAR::Error.

Throws

Several errors may be returned by getRecursive. The errornumber is unspecific (until now) and will not tell you anything about the errormessage. Possible errors are:

Table 38-1. Possible PEAR_Error values

Error messageDescriptionSolution
Given remote-path '$remote_path' seems not to be a directory. The path you specified on the FTP sever seems not to be a valid directory node. Maybe your path does not end with '/' or the directory does not exist.
Given local-path '$local_path' seems not to be a directory. The path you specified on the local host seems not to be a valid directory node. Maybe your path does not end with '/' or the directory does not exist.
Could not create dir '$local_path'. The given directory could not be created. Check your permissions on the source-directory.
Could not create dir '$local_path'. The given directory could not be created. Check your permissions on the source-directory.

Note

This function can not be called statically.

Example