This file contains hidden or 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
| <?php | |
| /** | |
| * A test vehicle to allow myself to learn the new RackSpace OpenCloud PHP SDK | |
| * | |
| */ | |
| // include the Rackspace Cloud files PHP API | |
| require 'rackspace_config.php'; | |
| require 'libraries/rackspace/vendor/autoload.php'; | |
| use OpenCloud\Rackspace; |
This file contains hidden or 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
| function getFile($id_file) { | |
| $fileRecord = $this->getFileRecord($id_file); | |
| $client = new Rackspace(Rackspace::UK_IDENTITY_ENDPOINT, array( // Note the use of | |
| 'username' => USER, | |
| 'apiKey' => PSWD | |
| )); | |
| // Create a service object to use the object store service. We give it the region name on LON (For London) as this is where are server and cloud files are |
This file contains hidden or 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
| <?php | |
| // no direct access | |
| defined( '_JEXEC' ) or die( 'Restricted access' ); | |
| header("Cache- Control: no-cache, must-revalidate" ); // HTTP/1.1 | |
| header("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); // Date in the past | |
| $doc = $this->archivingModel->getFile($this->form_data['id_file']); | |
| $file_type = $doc->content_type; | |
| $content_body = $doc->content_body; | |
| header("Content-Type: " . $file_type); |
OlderNewer