Code Monkey home page Code Monkey logo

codeigniter-s3-upload's Introduction

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

codeigniter-s3-upload's People

Contributors

alyahmmed avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

codeigniter-s3-upload's Issues

Deleting Object is not working

Hello, I am trying to delete the image (Uploaded by the give function in s3 upload lib) in following way...but it is not working

$file_url='https://'.$this->bucket_name.'.s3.amazonaws.com/'.$this->folder_name.$s3_file;
$this->CI->s3->deleteObject($my_bucket_name, $file_url);

Please suggest, if i am doing wrong...

Deprecated: Array and string offset access syntax with curly braces is deprecated in /app/application/libraries/S3.php on line 1535

Deprecated: Array and string offset access syntax with curly braces is deprecated in /app/application/libraries/S3.php on line 1535

A PHP Error was encountered
Severity: Warning

Message: finfo_file(): Failed identify data 0:(null)

Filename: libraries/S3_upload.php

Line Number: 27

Backtrace:

File: /app/application/libraries/S3_upload.php
Line: 27
Function: finfo_file

File: /app/application/controllers/user/Category.php
Line: 54
Function: upload_file

File: /app/index.php
Line: 315
Function: require_once

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.