function save_to_filename($filename)
    {
        $fp = @fopen($filename, "wb");
        if (!$fp) {
            throw new IOException("Could not open file for writing: ".$filename);
        }
        $result = $this->stream($fp);
        fclose($fp);
        return $result;
    }
function save_to_filename($filename)
    {
        $fp = @fopen($filename, "wb");
        if (!$fp) {
            throw new IOException("Could not open file for writing: ".$filename);
        }
        $result = $this->stream($fp);
        fclose($fp);
        return $result;
    }
function save_to_filename ( $ filename ) { $ fp = @ fopen ( $ filename , "wb" ) ; if ( ! $ fp ) { throw new IOException ( "Could not open file for writing: " . $ filename ) ; } $ result = $ this -> stream ( $ fp ) ; fclose ( $ fp ) ; return $ result ; }
Save Object's data to local filename

Given a local filename, the Object's data will be written to the newly
created file.

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

# Whoops!  I deleted my local README, let me download/save it
#
$my_docs = $conn->get_container("documents");
$doc = $my_docs->get_object("README");

$doc->save_to_filename("/home/ej/cloudfiles/readme.restored");
</code>

@param string $filename name of local file to write data to
@return boolean <kbd>True</kbd> if successful
@throws IOException error opening file
@throws InvalidResponseException unexpected response
Save Object s data to local filename