Net_FTP::put()

Net_FTP::put()

Net_FTP::put() -- upload a file to the FTP server.

Description

This uploads a file to the FTP server from the computer your script runs on.

Parameter

  • string $local_file - The source file you'd like to upload. You can specify this with either an absolute path or a path relative to the scripts directory. (Beware: The script directory is determined by the called script, if you use includes!)

  • string $remote_file - The path (including filename) you'd like to upload to. This could either be an absolute or relative path to a file (not a directory! see: Net_FTP::putRecursive()).

  • bool $overwrite = false - Whether to overwrite the remote file, if it exists or not. if not set the file will not be overwritten.

  • int $mode = null - This has to be one of the constants FTP_ASCII or FTP_BINARY. if not specified, the class will try to determine the mode from the file extension (from extensions.ini) or fall back to the standard transfer mode (attribute).

Return value

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

Note

This function can not be called statically.

© Copyright 2003-2023 www.php-editors.com. The ultimate PHP Editor and PHP IDE site.