如何使用Laravel将文件从s3存储桶下载到本地目录

时间:2019-11-11 03:10:21

标签: laravel amazon-web-services amazon-s3

我目前感到困惑,为什么我的exec命令将文件从s3下载到本地目录,而不是在laravel上运行,但是在AWS命令行界面中,我创建的命令正在下载并且运行良好。请参阅下面随附的参考。

AWS Command Interface

我这里有在公共函数上创建的示例代码

功能

public function send_zip_files_to_store() {

    $source = 's3://compexp/11-10-2019/01790exp.zip';
    $destination = 'C:\xampp\htdocs';
    exec('aws cp sync ' . $source . ' ' . $destination);

}

路线:

Route::get('/send_zip_files_to_store','DashController@send_zip_files_to_store')->name('send_zip_files_to_store');

0 个答案:

没有答案