duanshang9426 2017-04-07 22:40
浏览 164

将文件夹上传到Google云端存储

I would like to upload a folder with more than 100,000 files (more than 30GB), from my remote server to Google Cloud Storage. On the server I have I can not install gsutil. Is there a better way to upload the files? Using the API, that's how it is.

 $files = scanDir::scan("../../system_flex/Faturas/Media/", false, true);

$data = array();
foreach ($files as $file) {
    $arquivo = str_replace("//", "/", str_replace("../../system_flex/Faturas/", "", str_replace("\\", "/", $file)));
    $upload = $bucket->upload(
       fopen($file, 'r'), array( 'name' => $arquivo )
    );
}

That way it creates many requests and is slow, is there any other way maybe using PHP or some program?

  • 写回答

1条回答 默认 最新

  • doucuyu2259 2017-04-19 11:52
    关注

    Move file remote server to google cloud storage is taken less time so you can use above code.

    i tested

    评论

报告相同问题?

悬赏问题

  • ¥20 access多表提取相同字段数据并合并
  • ¥20 基于MSP430f5529的MPU6050驱动,求出欧拉角
  • ¥20 Java-Oj-桌布的计算
  • ¥15 powerbuilder中的datawindow数据整合到新的DataWindow
  • ¥20 有人知道这种图怎么画吗?
  • ¥15 pyqt6如何引用qrc文件加载里面的的资源
  • ¥15 安卓JNI项目使用lua上的问题
  • ¥20 RL+GNN解决人员排班问题时梯度消失
  • ¥60 要数控稳压电源测试数据
  • ¥15 能帮我写下这个编程吗