dongshan3806
2012-07-01 22:51
采纳率: 0%
浏览 28
已采纳

PHP Imagick:直接将图像写入Amazon S3?

Is it possible for me to use the writeImage function in Imagick to write an image directly to an S3 bucket? If so, how? I'm pretty new to the Amazon S3 SDK, so some help would be appreciated.

图片转代码服务由CSDN问答提供 功能建议

我是否可以使用Imagick中的writeImage函数将图像直接写入S3存储桶? 如果是这样,怎么样? 我对Amazon S3 SDK很陌生,所以一些帮助将不胜感激。

  • 写回答
  • 好问题 提建议
  • 关注问题
  • 收藏
  • 邀请回答

1条回答 默认 最新

  • douguachan2879 2012-07-01 22:58
    已采纳

    With writeImage, probably not (it takes a file path as argument, thus writing the file to the filesystem), but you can getImageBlob to get the image as binary string which you can then easily write to S3 with certain name. It would be easiest for you to use an S3 PHP library, there is one official in the AWS PHP SDK, or there are 3rd party libraries as well, such as this one:

    https://github.com/mackstann/amazon-s3-php-class
    // Put an object from a string:
    $s3->putObject($string, $bucketName, $uploadName, S3::ACL_PUBLIC_READ)
    
    已采纳该答案
    评论
    解决 无用
    打赏 举报

相关推荐 更多相似问题