Laravel 5: How do you copy a local file to Amazon S3?

后端 未结 6 2102
心在旅途
心在旅途 2021-02-08 11:53

I\'m writing code in Laravel 5 to periodically backup a MySQL database. My code thus far looks like this:

    $filename = \'database_backup_\'.date(\'G_a_m_d_y\         


        
6条回答
  •  日久生厌
    2021-02-08 12:44

    You can try this code

    $contents = Storage::get($file);
    Storage::disk('s3')->put($newfile,$contents);
    

    As Laravel document this is the easy way I found to copy data between two disks

提交回复
热议问题