Last active
December 19, 2015 22:39
-
-
Save icanhazdevops/6029442 to your computer and use it in GitHub Desktop.
temp url
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// connect to Cloud Files | |
$objstore = $connection->ObjectStore('cloudFiles', 'DFW'); | |
// Set a secret | |
define('TEMP_URL_SECRET', 'This is my secret'); | |
$objstore->SetTempUrlSecret(TEMP_URL_SECRET); | |
// Put the container and file names | |
$mycontainer = $objstore->Container('CdnContainer'); | |
$object = $mycontainer->DataObject('FOOBAR'); | |
// Create the temp url | |
$tempurl = $object->TempUrl(TEMP_URL_SECRET, 20, 'GET'); | |
// Print stuff for testing | |
printf("Filename: %s\n", $object->Name()); | |
printf("CDN URL: %s\n", $object->PublicURL()); | |
printf("TEMP URL: %s\n", $tempurl); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment