Created
April 22, 2014 09:07
-
-
Save jamiehannaford/11171148 to your computer and use it in GitHub Desktop.
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
<?php | |
// Method 1: Retrieve file details using HEAD | |
$file = $container->getObject('foo.jpg'); | |
// Method 2: Only set the name (which is the only requirement for an update) | |
$file = $container->dataObject(); | |
$file->setName('foo.jpg'); | |
// Now update content | |
$handle = fopen('/path/to/new/content', 'r+'); | |
$file->setContent($handle); | |
$file->update(); | |
fclose($handle); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment