【问题标题】:Is it possible to upload image from url to google cloud Using php?是否可以使用 php 将图像从 url 上传到谷歌云?
【发布时间】:2018-09-26 21:23:42
【问题描述】:

我想使用 PHP 库将图像从图像 URL 上传到谷歌云存储

【问题讨论】:

    标签: php google-cloud-storage


    【解决方案1】:

    【讨论】:

    • 我没有使用 appengine 。我正在使用 php API
    • 这和你的情况类似。 stackoverflow.com/questions/27744548/…
    • 我已经在使用 Php api 做类似的事情,但我想将 adobe 中编辑的图像上传到谷歌云特定文件夹
    【解决方案2】:

    看看这个:

    您可以使用这个简单的 PHP 脚本将文件从一台服务器移动到另一台服务器。

    https://shellcreeper.com/move-files-server-to-server-using-simple-php/

    【讨论】:

      【解决方案3】:

      是的,您可以使用 file_get_contents() 获取图片网址

      $file = file_get_contents($imageURL);
      
      $object = $bucket->upload
      (
          $file,
      
          [
              'name' => 'image-name.png',
              'predefinedAcl' => 'publicRead'
          ]
      );
      

      【讨论】:

      • 这个问题是 2 年前提出的 :)
      • 也许它会对其他人有所帮助:)
      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2018-02-15
      • 2015-02-28
      • 2013-11-30
      • 2018-06-08
      • 1970-01-01
      • 1970-01-01
      • 2020-03-19
      相关资源
      最近更新 更多