【问题标题】:Upload a large folder to Amazon S3将大文件夹上传到 Amazon S3
【发布时间】:2014-12-21 23:02:05
【问题描述】:

我知道如何将单个文件上传到 Amazon S3,我使用这个:

 <?php
//include the S3 class
if (!class_exists('S3'))
    require_once('S3.php');
//AWS access info
$s3 = new S3(awsAccessKey, awsSecretKey);
if ($s3->putObjectFile("movie.mp4", "mybucket", "movie-on-aws.mp4", S3::ACL_PUBLIC_READ)) {
    echo "<strong>We successfully uploaded your file.</strong>";
} else {
    echo "<strong>1 Something went wrong while uploading your file... sorry.</strong>";
}?>

我有一个 1TB 的大型视频目录,我想将它们上传到 Amazon S3。

我尝试递归循环遍历每个目录并单独上传每个文件,但失败了。只是因为文件命名、服务器超时问题等会出现太多的错误......

我希望存储桶反映我的确切目录结构。我要复制的文件夹保存在为 Apache 服务的专用服务器上。

有没有办法通过 API 上传文件夹?也是 1TB,那么最好的解决方案是什么?

【问题讨论】:

  • but it failed, Its just that too many bugs will occur due to file naming, server timeout issues, etc...。这并没有太大帮助,因为不清楚您希望最终结果是什么。您是否希望每个视频文件成为同一存储桶中的单独 S3 对象?您想要整个 1 TB 目录的压缩文件吗?您希望存储桶镜像您的目录结构吗?请说明您想要的输出是什么。
  • 您想尝试使用s3cmd 之类的方法来处理上传。

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


【解决方案1】:

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2014-10-24
    • 1970-01-01
    • 1970-01-01
    • 2021-12-09
    • 2019-12-10
    • 2013-09-09
    • 2015-10-28
    • 1970-01-01
    相关资源
    最近更新 更多