dpc57092 2017-02-23 15:21
浏览 16

使用PHP将一个S3存储桶的文件夹(大小为150MB - 200MB)复制到另一个不同区域的S3存储桶

I want to copy a folder (size 150MB - 200MB) of one S3 bucket to another S3 bucket of the different region using PHP or in S3 term "duplicate all objects with the prefix of an S3 bucket into objects with a different prefix to another S3 bucket"

I have tried below code but it's not workings

$s3 = new S3Client(['credentials' => $credentials, 'version' => 'latest','region' => $region,'debug' => false ]); 
$s3->registerStreamWrapper(); 
$result = $s3->uploadDirectory("s3://{$source_bucket}/{$key}",$target_‌​bucket);

and I have also tried to list out all objects (using listObject function) from source bucket then copy it (Using copyObject function ) into destination bucket. But this process is consuming too much time.

Any suggestion

  • 写回答

2条回答 默认 最新

  • dsl2014 2017-02-23 15:28
    关注

    If you are not trying to do an automated copy, you should use the S3 console.

    Someone had your problem before: How can I copy clone/duplicate a folder on S3?

    评论

报告相同问题?

悬赏问题

  • ¥15 有偿求跨组件数据流路径图
  • ¥15 写一个方法checkPerson,入参实体类Person,出参布尔值
  • ¥15 我想咨询一下路面纹理三维点云数据处理的一些问题,上传的坐标文件里是怎么对无序点进行编号的,以及xy坐标在处理的时候是进行整体模型分片处理的吗
  • ¥15 CSAPPattacklab
  • ¥15 一直显示正在等待HID—ISP
  • ¥15 Python turtle 画图
  • ¥15 关于大棚监测的pcb板设计
  • ¥15 stm32开发clion时遇到的编译问题
  • ¥15 lna设计 源简并电感型共源放大器
  • ¥15 如何用Labview在myRIO上做LCD显示?(语言-开发语言)