Update README.md

This commit is contained in:
Devang Srivastava 2017-12-07 22:20:13 +05:30 committed by GitHub
parent e0da836965
commit bdf2ee404e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -3,8 +3,6 @@ An API wrapper for DigitalOcean's Spaces object storage designed for easy use.
 
### Connecting
```php
require_once("spaces.php");
@ -25,9 +23,6 @@ All available options:
### Uploading/Downloading Files
```php
$path_to_file = "folder/my-image.png";
@ -38,7 +33,7 @@ $space->uploadFile($path_to_file, $optional_file_name);
$download_file = "image.png";
$save_as = "/folder/downloaded-image.png";
$save_as = "folder/downloaded-image.png";
$space->downloadFile($download_file, $save_as);
```
@ -52,9 +47,6 @@ All available options:
### Creating Temporary Links
```php
$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: