PHP code example of bag / digitalocean-spaces-helpers

1. Go to this page and download the library: Download bag/digitalocean-spaces-helpers library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

bag / digitalocean-spaces-helpers example snippets


foreach ($client->iterate('my-space', true, ['Prefix' => 'reports/'], maxItems: 100) as $key) {
    // Process one key without loading the complete listing into memory.
}
constructor($key, $secret, $region)
createSpace($name)
deleteSpace($name)
listPage($space, $keys = false, $arguments = [], $cursor = null)
iterate($space, $keys = false, $arguments = [], $maxItems = null, $maxPages = 1000)
get($space, $key, $arguments = [])
upload($space, $key, $content, $public = false, $arguments = [])
uploadFile($space, $key, $file, $public = false, $arguments = [])
multipartUploadFile($space, $key, $file, $public = false, $arguments = [])
presignedDownload($space, $key, $duration = '+5 minutes')
presignedUpload($space, $key, $duration = '+5 minutes', $contentType = null)
baseKey($key)
verifyRequest(&$request, $key, $default = [])
createClient($key, $secret, $endpoint)
create($key, $secret, $endpoint)
construct($space, $key, $secret, $region, $create = false)
get($key, $arguments = [])
getAcl($key)
setAcl($key, $acl)
upload($key, $content, $public = false, $arguments = [])
uploadFile($key, $file, $public = false, $arguments = [])
multipartUploadFile($key, $file, $public = false, $arguments = [])
download($key, $destination)
publicUrl($key)
presignedDownload($key, $duration = '+5 minutes')
presignedUpload($key, $type, $duration = '+5 minutes')
delete($key)
construct($key, $secret)