PHP AWS S3 Integration Library provides an easiest way to integrate AWS S3 in a PHP project. Using this library you can use the S3(Simple Storage Service by Amazon) Bucket as a storage for user uploaded files in your project.
Note: In order to use S3 as a storage you do not need to host your project on AWS. You can use S3 service from any hosting server, even from your local Server too.
See how easy it is to use, with sample codes.
- Installation wizard helps you to setup AWS configuration very easily.
- Upload user uploaded files in S3 bucket directly, without storing on web-server.
- Manually upload/copy any web-server file to a S3 bucket.
- Copy a S3 file from one Bucket to another or in same Bucket.
- Create unlimited S3 Buckets in AWS account.
- Easily delete a file from S3 Bucket.
- Link any S3 file with a single easy to use function.
- Detailed documentation showing every aspect and use of library.
Using uploaded_file_to_s3() function, the uploaded file will store on same relative location in an S3 Bucket instead of web-server.
//Normal code to upload a file on web-server
move_uploaded_file($_FILES["file"]["tmp_name"], "upload/" . $_FILES["file"]["name"]);
uploaded_file_to_s3($_FILES["file"], "uploads", true);
Using site_url_s3() function, File will be referenced from same relative location from S3 Bucket instead of web-server.
//Normal code to refer a file on web-server
<a href="<?php echo site_url_s3(" uploads="">">Download/View</a>
Upload a file manually from the web-server to an S3 bucket
//Upload uploads/myphoto.jpg file to S3 Bucket.
uploaded_file_to_s3_manually("uploads", "myphoto.jpg", "uploads", true);
Copy a S3 file from one Bucket to another or in same Bucket
//Copy S3 File
To create a S3 Bucket in your AWS account
//Create a S3 Bucket
I will be more then happy to help and provide support you through any problems you may have, or and features/suggestions that you want to implement. Just send me an email or leave a comment.
Note: AWS/S3 and Codeigniter are the Trademarks of their respective owners.