Skip to main content

How Do I Upload Files to an S3 Bucket in Codeigniter

If your website has a lot of images or videos, you can put them on S3. If you keep them on own server ,it will increase load on server. One of the biggest problem is that its your server processing all the requests to your images and also in the process increasing load on your server. When you upload a file to Amazon S3, it is stored as an S3 object. Objects consist of the file data and metadata that describes the object. You can have an unlimited number of objects in a bucket.

You can upload any file type—images, backups, data, movies, etc.—into an S3 bucket. The maximum size of a file that you can upload by using the Amazon S3 console is 78 GB.

  • Amazon simple storage service or Amazon S3 provides developers and our IT teams with saving, secure object storage.
  • Amazon S3 helps you get the most out of your data by making sure its storage safely available when needed and will scale as your needs grow.
  • You can store as much data as you want and access it when you need it. When it comes to storage the last thing you wanna worry about is losing valuable data.

Low Cost:

Hosting Images on Amazon S3 gives you the ability to store a large amount of data with a very low cost. It uses lifecycle policies, you can set policies to migrate your data automatically to standard – infrequent access. Amazon Glacier further reduces cost.

With Amazon S3 you only pay for your what you use. While hosting on your own server is expensive and its price is fixed. Whether you use it or not you have to pay for it.

Firstly create a library called S3.php (location application/libraries/S3.php)

Now create a controller fileupload.php under (application/controllers)

Now create a function in model

Recomended Tutorial

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.