Welcome Guest, Not a member yet? Register   Sign In
How to use Amazon s3 in Codeigniter?

I know there are a lot of CI libraries created to work with s3 but I would like to use the native PHP SDK released by amazon instead.

It works just fine when I use it outside CI, that is I am able to create buckets, upload files to them, etc. But when I put it inside CI and call it like so in my home controller:

require_once 'sdk-';
$s3 = new AmazonS3();

I get the error:
Quote:Fatal error: Class 'AmazonS3' not found in /var/www/application/controllers/home.php on line 26

Same issue if I use the SDK as a CI Library. Does anyone know how to get this to work?

Linuxjuggler has a spark that uses the Amazon's PHP SDK. You can see how he integrates it on github.

[quote author="kanjimaster" date="1339273443"]Linuxjuggler has a spark that uses the Amazon's PHP SDK. You can see how he integrates it on github.[/quote]

This looks promising but how do I get the
function to work, I get this error:

Quote:Fatal error: Call to undefined method CI_Loader:Confusedpark() in /var/www/application/controllers/home.php on line 26

You will need CodeIgniter sparks to run


which you can get more info on at


But I think you should be able to use the S3-Library without sparks as well. There should be some documentation on its GH page

Thanks guys, I got Linuxjuggler's code to work as a standard library without using spark.

Hey, you can use this library http://codecanyon.net/item/codeigniter-a...ry/4993914 to integrate S3 in Codeigniter. It is awesome library and makes the thing easy. you just need to call one function to use this. And the best part is it usages the original latest AWS PHP sdk provided by AWS in this.

Theme © iAndrew 2016 - Forum software by © MyBB