what php API can be used to upload and download files to Amazon S3

0 votes
I have a website hosted on amazon. I want my clients to give access to upload files that are already in their amazon s3 space to my s3 space. Is there any php API that supports this functionality?
Oct 17, 2018 in AWS by findingbugs
• 4,730 points
475 views

1 answer to this question.

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.
0 votes

Amazon have a PHPSDK , check the sample code

// The sample code below demonstrates how Resource APIs work


$aws = new Aws($config);

// Get references to resource objects



$bucket = $aws->s3->bucket('my-bucket');

$object = $bucket->object('image/bird.jpg');

// Access resource attributes


echo $object['LastModified'];

// Call resource methods to take action


$object->delete();

$bucket->delete();

Or use old s3.php for uploading files to s3 bucket. its a single php file named s3.php You just download that and from your code . for more read this.

<?php


if (!class_exists('S3'))require_once('S3.php');
//AWS access info
if (!defined('awsAccessKey')) define('awsAccessKey', 'YourAccess S3 Key');
if (!defined('awsSecretKey')) define('awsSecretKey', 'Yor Secret Key');
//instantiate the class
$s3 = new S3(awsAccessKey, awsSecretKey);
$s3->putBucket("bucket name", S3::ACL_PRIVATE);

//move the file
if ($s3->putObjectFile("your file name in the server with path", "which bucket ur using (bucket name)", "fine name in s3 server", S3::ACL_PRIVATE)) {

//s3 upload success

}
?>
answered Oct 17, 2018 by Priyaj
• 56,140 points

Related Questions In AWS

+1 vote
1 answer

What tools can be used to spin-up servers on AWS?

Yes. There are a lot of tools ...READ MORE

answered Dec 19, 2018 in AWS by Archana
• 5,360 points
61 views
0 votes
1 answer

What are the services that can be used with Amazon VPC?

Almost all the services provided by AWS ...READ MORE

answered Mar 5 in AWS by Ravish
19 views
+1 vote
5 answers

Can Celery be used with Amazon SQS

I regenerated the credentials in the IAM ...READ MORE

answered Oct 25, 2018 in AWS by triedntested
223 views
+1 vote
4 answers

Can a URL be directly uploaded to S3 using POST?

You can read this blog and get ...READ MORE

answered Oct 25, 2018 in AWS by chamunda
32 views
0 votes
1 answer

AWS S3 uploading hidden files by default

versioning is enabled in your bucket. docs.aws.amazon.com/AmazonS3/latest/user-guide/….... the ...READ MORE

answered Oct 4, 2018 in AWS by Priyaj
• 56,140 points
107 views
0 votes
1 answer

How to decrypt the encrypted S3 file using aws-encryption-cli --decrypt

Use command : aws s3 presign s3://mybucket/abc_count.png you get ...READ MORE

answered Oct 22, 2018 in AWS by Priyaj
• 56,140 points
219 views
0 votes
1 answer

Import my AWS credentials using python script

Using AWS Cli  Configure your IAM user then ...READ MORE

answered Nov 16, 2018 in AWS by Jino
• 5,520 points
133 views
0 votes
2 answers
0 votes
1 answer

What is the difference between Amazon Cloudfront and S3

major difference is that cloudfront allows you ...READ MORE

answered Jul 9, 2018 in AWS by Priyaj
• 56,140 points
79 views

© 2018 Brain4ce Education Solutions Pvt. Ltd. All rights Reserved.
"PMP®","PMI®", "PMI-ACP®" and "PMBOK®" are registered marks of the Project Management Institute, Inc. MongoDB®, Mongo and the leaf logo are the registered trademarks of MongoDB, Inc.