Magi
Magi

Reputation:

how do i copy/upload file from S3 to EC2 in PHP

I am having a file on S3 Example: test-company/upload/abc.txt I want to upload this abc.txt to my EC2 in php Do anybody having any idea please share it with example..

Upvotes: 0

Views: 2698

Answers (4)

David Snabel-Caunt
David Snabel-Caunt

Reputation: 58361

I've used amazon-s3-php-class which works great.

Zend Framework also has AWS support though you can't use it with Europe until ZF 1.8.2 is released. (Due to a bug in 1.8.1 that has been fixed in svn now)

Upvotes: 3

Matt
Matt

Reputation: 2902

There is no method to "upload to EC2" as it is an instance of a virtual server and not a storage service. You would need to put your own service on EC2 in order to upload to it.

You can, however, download from S3 to EC2. Simply run wget or similar on the EC2 instance to pull down the file from S3 bucket URL (with authentication if necessary).

Upvotes: 0

fiskah
fiskah

Reputation: 5902

I'd go for the new Zend Framework (1.8) implementation. Haven't really checked it out yet but you can find it at http://framework.zend.com/. Docs here: http://framework.zend.com/manual/en/zend.service.amazon.s3.html

Upvotes: 0

tronda
tronda

Reputation: 3942

I've used a linux utility called s3cmd. I guess you could easily call this command line utility from PHP.

Upvotes: 0

Related Questions