versionsixnine / CodeIgniter-S3-Upload-master

Uploading file to Amazon s3 bucket using CodeIgniter - php work with AWS4-HMAC-SHA256

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Amazon S3 Upload Library for CodeIgniter

Easily integrate your CI applications to Amazon’s Simple Storage Solution with this library.

Setup

  1. Create Amazon S3 account
  2. Create a bucket for the files
  3. Get Amazon S3 API key and secret
  4. Edit config/s3.php with your appropriate settings
  5. Copy config and library files to your CI installation

Example Usage


  // 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"

References

About

Uploading file to Amazon s3 bucket using CodeIgniter - php work with AWS4-HMAC-SHA256


Languages

Language:PHP 100.0%