Back to FtpClient class

Method restart

public bool
restart
(mixed $point)
Method to restart data transfer at a given byte
Parameters
  • int $point Byte to restart transfer at
Returns
  • bool True if successful
Since
  • 1.5
Class: FtpClient
Project: Joomla

Method restart - Source code

/**
 * Method to restart data transfer at a given byte
 *
 * @param   integer  $point  Byte to restart transfer at
 *
 * @return  boolean  True if successful
 *
 * @since   1.5
 */
public function restart($point)
{
    // If native FTP support is enabled let's use it...
    if (FTP_NATIVE) {
        if (@ftp_site($this->_conn, 'REST ' . $point) === false) {
            Log::add(Text::sprintf('JLIB_CLIENT_ERROR_FTP_BAD_RESPONSE', __METHOD__), Log::WARNING, 'jerror');
            return false;
        }
        return true;
    }
    // Send restart command and verify success
    if (!$this->_putCmd('REST ' . $point, 350)) {
        Log::add(Text::sprintf('JLIB_CLIENT_ERROR_FTP_RESTART_BAD_RESPONSE', __METHOD__, $this->_response, $point), Log::WARNING, 'jerror');
        return false;
    }
    return true;
}