我在 Dropbox 上有大型设计文件(最大 500 MB),我正在构建一个工具,用于在我们基于 PHP 的在线项目管理程序中以编程方式将单个文件传输到供应商的 FTP 服务器。由于文件大小,由于速度和存储空间问题,我不想将文件下载到服务器,然后将该文件上传到 FTP 服务器。
我可以使用以下 Dropbox API 调用:
getFile( string $path, resource $outStream, string|null $rev = null )
Downloads a file from Dropbox. The file's contents are written to the given $outStream and the file's metadata is returned.
我猜我可以使用以下 PHP 命令:
ftp_fput ( resource $ftp_stream , string $remote_file , resource $handle , int $mode [, int $startpos = 0 ] )
Uploads the data from a file pointer to a remote file on the FTP server.
我对文件数据流没有任何经验,所以我不知道如何将两者联系起来。经过几个小时的在线搜索,我想我会尝试在这里询问。
如何将 getFile 的 $outstream 资源与 ftp_fput 的 $ftp_stream 资源连接起来?