如何从Amazon S3服务器Laravel获取文件?

时间:2016-02-12 13:45:30

标签: laravel amazon-s3

我正在尝试编写并将文件下载到Amazon S3。该文件已加载但我无法取回:

public function testS3() 
{
    $s3 = Storage::disk('s3');

    $url = 'https://fbcdn-sphotos-c-a.akamaihd.net/hphotos-ak-xpa1/v/t1.0-9/p720x720/12631558_953568381347717_3978737099026165391_n.jpg?oh=9e14f5ea6f8e3a3fc8ffa07095d4c766&oe=57321C9D&__gda__=1463610491_c1f275837b7f5b4d2041597a3d7bb9c8';        
    $file = file_get_contents($url);

    $s3->put('upload/test/file1.jpg', $file);

    // download        
    $contents = $s3->get('upload/test/file1.jpg');        
    dd($contents);
}

我收到此错误:

    FileNotFoundException in FilesystemAdapter.php line 58:
    upload/test/file1.jpg

0 个答案:

没有答案