将本地存储的文件移动到Amazon S3 [英] Moving a file stored locally to amazon S3

查看:307
本文介绍了将本地存储的文件移动到Amazon S3的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个脚本(PHP),用于存储用户上传到我的服务器的图像。上传完文件(涉及一些处理)后,我想将处理后的文件移至S3。

I have a script (PHP) that stores an image uploaded by a user to my server. After it is uploaded (which involves some processing) I want to move that processed file to S3.

只需明确一点,这就是我要实现的目标:

Just to be clear, here is what I would like to achieve:


  1. 让用户将文件上传到我的服务器上

  2. 处理映像(调整大小等)

  3. 使用特定的命令将处理后的映像移动到我的S3存储桶中动态生成的名称,例如123876542234.jpg

  4. 获取我的S3存储桶中可公开访问文件的地址

  1. Let user upload file to my server
  2. Process image (resize etc.)
  3. Move processed image to my S3 bucket with a specific dynamically generated name, eg. 123876542234.jpg
  4. Get out the address of the publicly accessible file in my S3 bucket

我没有使用S3的经验,但是对PHP有很深的了解。我尝试了一些教程,但都没有用。任何帮助将不胜感激。

I have no experience with using S3 but have a strong grasp of PHP. I tried a few tutorials but none of them worked. Any help would be greatly appreciated.

推荐答案

确保获得较新的版本2。它具有更快,更可靠的HTTP层。 ,并使用了诸如迭代器和观察器之类的现代概念。

Make sure you get the newer version 2. It has a faster and more reliable HTTP layer, and uses modern concepts such as Iterators and Observers.

以下是一些针对S3的文档。 https://github.com/aws/aws -sdk-php / blob / master / docs / service-s3.rst 。这是所有其他文档。 http://aws.amazon.com/documentation/sdkforphp2/

Here's some S3-specific documentation. https://github.com/aws/aws-sdk-php/blob/master/docs/service-s3.rst. Here's all of the other documentation. http://aws.amazon.com/documentation/sdkforphp2/

这篇关于将本地存储的文件移动到Amazon S3的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆