Easily integrate your CI applications to Amazon’s Simple Storage Solution with this library.
- Create Amazon S3 account
- Create a bucket for the files
- Get Amazon S3 API key and secret
- Edit config/s3.php with your appropriate settings
- Copy config and library files to your CI installation
// Load Library
$this->load->library('s3_upload');
// Upload file
$sample_file = APPPATH.'public/img/apple.gif';
$file_url = $this->s3_upload->upload_file($sample_file);
var_dump($file_url);
// string(56) "https://bucket-name.s3.amazonaws.com/files/apple-561.gif"