function load_from_filename($filename, $verify=True)
    {
        $fp = @fopen($filename, "r");
        if (!$fp) {
            throw new IOException("Could not open file for reading: ".$filename);
        }

        clearstatcache();
        
        $size = (float) sprintf("%u", filesize($filename));
        if ($size > MAX_OBJECT_SIZE) {
            throw new SyntaxException("File size exceeds maximum object size.");
        }

        $this->_guess_content_type($filename);
        
        $this->write($fp, $size, $verify);
        fclose($fp);
        return True;
    }
function load_from_filename($filename, $verify=True)
    {
        $fp = @fopen($filename, "r");
        if (!$fp) {
            throw new IOException("Could not open file for reading: ".$filename);
        }

        clearstatcache();
        
        $size = (float) sprintf("%u", filesize($filename));
        if ($size > MAX_OBJECT_SIZE) {
            throw new SyntaxException("File size exceeds maximum object size.");
        }

        $this->_guess_content_type($filename);
        
        $this->write($fp, $size, $verify);
        fclose($fp);
        return True;
    }
function load_from_filename ( $ filename , $ verify = True ) { $ fp = @ fopen ( $ filename , "r" ) ; if ( ! $ fp ) { throw new IOException ( "Could not open file for reading: " . $ filename ) ; } clearstatcache ( ) ; $ size = ( float ) sprintf ( "%u" , filesize ( $ filename ) ) ; if ( $ size > MAX_OBJECT_SIZE ) { throw new SyntaxException ( "File size exceeds maximum object size." ) ; } $ this -> _guess_content_type ( $ filename ) ; $ this -> write ( $ fp , $ size , $ verify ) ; fclose ( $ fp ) ; return True ; }
Upload Object data from local filename

This is a convenience function to upload the data from a local file.  A
True value for $verify will cause the method to compute the Object's MD5
checksum prior to uploading.

Example:
<code>
# ... authentication/connection/container code excluded
# ... see previous examples

$my_docs = $conn->get_container("documents");
$doc = $my_docs->get_object("README");

# Upload my local README's content
#
$doc->load_from_filename("/home/ej/cloudfiles/readme");
</code>

@param string $filename full path to local file
@param boolean $verify enable local/remote MD5 checksum validation
@return boolean <kbd>True</kbd> if data uploaded successfully
@throws SyntaxException missing required parameters
@throws BadContentTypeException if no Content-Type was/could be set
@throws MisMatchedChecksumException $verify is set and checksums unequal
@throws InvalidResponseException unexpected response
@throws IOException error opening file
Upload Object data from local filename