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

后端 未结 6 2100
心在旅途
心在旅途 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:53

    Looking at the documentation the only way is using method put which needs file content. There is no method to copy file between 2 file systems so probably the solution you gave is at the moment the only one.

    If you think about it, finally when copying file from local file system to s3, you need to have file content to put it in S3, so indeed it's not so wasteful in my opinion.

提交回复
热议问题