【发布时间】:2018-12-06 08:00:59
【问题描述】:
我想使用 sftp 将文件从本地移动到另一台服务器,这是我在 config/filesystem.php 中的 sftp 设置
'sftp' => [
'driver' => 'sftp',
'host' => '192.xxx.0.xxx',
'port' => 22,
'username' => 'xxx',
'password' => 'xxx',
'root' => '/',
'timeout' => 10,
],
这是我在控制器中的代码
$file_local = public_path().'/documents/1.pdf';
$file_sftp = Storage::disk('sftp')->put('1.pdf', $file_local);
$move = File::move($file_local, $file_ftp);
【问题讨论】:
标签: php laravel filesystems sftp move