mirror of
https://github.com/SociallyDev/Spaces-API.git
synced 2025-07-07 21:41:29 -07:00
Update README.md
This commit is contained in:
parent
e0da836965
commit
bdf2ee404e
1 changed files with 33 additions and 9 deletions
42
README.md
42
README.md
|
@ -3,8 +3,6 @@ An API wrapper for DigitalOcean's Spaces object storage designed for easy use.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
### Connecting
|
### Connecting
|
||||||
```php
|
```php
|
||||||
require_once("spaces.php");
|
require_once("spaces.php");
|
||||||
|
@ -25,9 +23,6 @@ All available options:
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
### Uploading/Downloading Files
|
### Uploading/Downloading Files
|
||||||
```php
|
```php
|
||||||
$path_to_file = "folder/my-image.png";
|
$path_to_file = "folder/my-image.png";
|
||||||
|
@ -38,7 +33,7 @@ $space->uploadFile($path_to_file, $optional_file_name);
|
||||||
|
|
||||||
|
|
||||||
$download_file = "image.png";
|
$download_file = "image.png";
|
||||||
$save_as = "/folder/downloaded-image.png";
|
$save_as = "folder/downloaded-image.png";
|
||||||
|
|
||||||
$space->downloadFile($download_file, $save_as);
|
$space->downloadFile($download_file, $save_as);
|
||||||
```
|
```
|
||||||
|
@ -52,9 +47,6 @@ All available options:
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
### Creating Temporary Links
|
### Creating Temporary Links
|
||||||
```php
|
```php
|
||||||
$file = "image.png";
|
$file = "image.png";
|
||||||
|
@ -68,6 +60,37 @@ All available options:
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### Other File APIs
|
||||||
|
```php
|
||||||
|
//List all files and folders
|
||||||
|
$files = $space->listObjects();
|
||||||
|
|
||||||
|
|
||||||
|
//Check if a file/folder by that name already exists. True/False.
|
||||||
|
$space->doesObjectExist($file_name);
|
||||||
|
|
||||||
|
|
||||||
|
//Pull information about a single object.
|
||||||
|
$file_info = $space->getObject($file_name);
|
||||||
|
|
||||||
|
|
||||||
|
//Delete a file/folder.
|
||||||
|
$space->deleteObject($file_name);
|
||||||
|
|
||||||
|
|
||||||
|
//Upload a complete directory instead of a single file.
|
||||||
|
$space->uploadDirectory($path_to_directory, $key_prefix);
|
||||||
|
|
||||||
|
|
||||||
|
//Pull Access Control List information.
|
||||||
|
$acl = $space-listObjectACL($file_name);
|
||||||
|
|
||||||
|
|
||||||
|
//Update Access Control List information.
|
||||||
|
$space->PutObjectACL($file_name, $acl_info_array);
|
||||||
|
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -87,3 +110,4 @@ All available options:
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue