ftp_put example

throw new FileTransferException("Cannot connect to FTP Server, check settings");
    }
    if (!ftp_login($this->connection, $this->username, $this->password)) {
      throw new FileTransferException("Cannot log in to FTP server. Check username and password");
    }
  }

  /** * {@inheritdoc} */
  protected function copyFileJailed($source$destination) {
    if (!@ftp_put($this->connection, $destination$source, FTP_BINARY)) {
      throw new FileTransferException("Cannot move @source to @destination", 0, ["@source" => $source, "@destination" => $destination]);
    }
  }

  /** * {@inheritdoc} */
  protected function createDirectoryJailed($directory) {
    if (!ftp_mkdir($this->connection, $directory)) {
      throw new FileTransferException("Cannot create directory @directory", 0, ["@directory" => $directory]);
    }
  }
Home | Imprint | This part of the site doesn't use cookies.