项目作者: norbybaru

项目描述 :
Amazon Codeigniter aws S3 storage
高级语言: PHP
项目地址: git://github.com/norbybaru/codeigniter-aws-s3.git
创建时间: 2018-09-21T15:57:33Z
项目社区:https://github.com/norbybaru/codeigniter-aws-s3

开源协议:

下载


Codeigniter AWS S3

Amazon aws S3 storage libary for codeigniter

Setup

  1. Copy config and library files to your CI installation
  2. Edit config/aws.php and config/storage.php with your appropriate settings

Example Usage

  1. //Load storage libray
  2. $this->load->library('storage');
  3. //Upload uploaded file to S3 or local storage
  4. $this->storage->put('images');
  5. or
  6. //Upload file to S3 or local storage
  7. $this->storage->putFile($filePath, $fileName);

Class Methods

Storage Library:

  • put() - Upload file
  • putFile() - Upload file using file path
  • initConfig() - Override config/storage.php values
  • getDisk() - Get the current disk setting. eg. s3, local
  • file() - Return UploadFile class with uploaded file details

S3 Libray

  • url() - Return file url
  • read() - Read file on s3 if it exist
  • remove() - Remove file from s3
  • exist() - Check if file exist on s3
  • upload() - Upload file to s3
  • write() - Upload file to s3
  • copyFile() - Copy file to s3
  • setBucket() - Set bucket to use