raminsherwani / DigitalOcean-Spaces-Codeigniter

Library for using Digital Ocean Spaces storage with Codeigniter Framework

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

DigitalOcean-Spaces-Codeigniter

Library for using Digital Ocean Spaces storage with Codeigniter Framework. This is based on https://github.com/SociallyDev/Spaces-API. Visit the link to see the original usage.

How to Connect to your Space

Please edit application/libraries/Space.php
  $key = "xxxxxxxxx";
  $secret = "xxxxxxxxx";
  $space_name = "xxxxxx";
  $region = "xxxxxx";
        
 $this->space = new SpacesConnect($key, $secret, $space_name, $region); 

How to upload files to your Space

$photo = "myfile.png";
$new_filename = "mynewfilename.png";

$this->space->space->UploadFile($photo, "public", "path_for_your_file/".$new_filename, "image/png");
#space will create new folder automatically

How to delete files from your Space

$photo = "myfile.png";
$this->space->space->DeleteObject("path_for_your_file/".$photo);

About

Library for using Digital Ocean Spaces storage with Codeigniter Framework


Languages

Language:PHP 100.0%