public function write($filename = null)
    {
        if ($filename === null) {
            $filename = $this->getFilename();
        }
        if (empty($filename)) {
            $filename = 'file';
        }

        if (! $handle = fopen($filename, 'w')) {
            trigger_error('Can not open the destination file', E_USER_ERROR);
            return 0;
        }

        $written = $this->copyToResource($handle);
        fclose($handle);

        return $written;
    }
public function write($filename = null)
    {
        if ($filename === null) {
            $filename = $this->getFilename();
        }
        if (empty($filename)) {
            $filename = 'file';
        }

        if (! $handle = fopen($filename, 'w')) {
            trigger_error('Can not open the destination file', E_USER_ERROR);
            return 0;
        }

        $written = $this->copyToResource($handle);
        fclose($handle);

        return $written;
    }
public function write ( $ filename = null ) { if ( $ filename === null ) { $ filename = $ this -> getFilename ( ) ; } if ( empty ( $ filename ) ) { $ filename = 'file' ; } if ( ! $ handle = fopen ( $ filename , 'w' ) ) { trigger_error ( 'Can not open the destination file' , E_USER_ERROR ) ; return 0 ; } $ written = $ this -> copyToResource ( $ handle ) ; fclose ( $ handle ) ; return $ written ; }
Writes this file to the filesystem
@link http://php.net/manual/en/mongogridfsfile.write.php
@param string $filename The location to which to write the file (path+filename+extension). If none is given, the stored filename will be used.
@return int Returns the number of bytes written
Writes this file to the filesystem