Baike.dev
All toolsOnline toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
A

amazon-s3-php-class

> 编程语言
Open source

A standalone Amazon S3 (REST) client for PHP 5/CURL

1.0K stars0 likes0 views
WebsiteGitHub

About

A standalone Amazon S3 (REST) client for PHP 5/CURL

Amazon S3 PHP Class

Usage

OO method (e,g; $s3->getObject(...)):

php
$s3 = new S3($awsAccessKey, $awsSecretKey);

Statically (e,g; S3::getObject(...)):

php
S3::setAuth($awsAccessKey, $awsSecretKey);

Object Operations

Uploading objects

Put an object from a file:

php
S3::putObject(S3::inputFile($file, false), $bucketName, $uploadName, S3::ACL_PUBLIC_READ)

Put an object from a string and set its Content-Type:

php
S3::putObject($string, $bucketName, $uploadName, S3::ACL_PUBLIC_READ, array(), array('Content-Type' => 'text/plain'))

Put an object from a resource (buffer/file size is required - note: the resource will be fclose()'d automatically):

php
S3::putObject(S3::inputResource(fopen($file, 'rb'), filesize($file)), $bucketName, $uploadName, S3::ACL_PUBLIC_READ)

Retrieving objects

Get an object:

php
S3::getObject($bucketName, $uploadName)

Save an object to file:

php
S3::getObject($bucketName, $uploadName, $saveName)

Save an object to a resource of any type:

php
S3::getObject($bucketName, $uploadName, fopen('savefile.txt', 'wb'))

Copying and deleting objects

Copy an object:

php
S3::copyObject($srcBucket, $srcName, $bucketName, $saveName, $metaHeaders = array(), $requestHeaders = array())

Delete an object:

php
S3::deleteObject($bucketName, $uploadName)

Bucket Operations

Get a list of buckets:

php
S3::listBuckets()  // Simple bucket list
S3::listBuckets(true)  // Detailed bucket list

Create a bucket:

php
S3::putBucket($bucketName)

Get the contents of a bucket:

php
S3::getBucket($bucketName)

Delete an empty bucket:

php
S3::deleteBucket($bucketName)

Issues· 0 open

View all issuesOpen on GitHub

No open issues yet, or sync has not completed.

> Tags

PHPamazon-s3awsaws-s3libcurl

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedSep 17, 2026
Category编程语言
PricingOpen source

> Related tools

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言