public function openUploadStream($filename, array $options = [])
    {
        $options += ['chunkSizeBytes' => $this->chunkSizeBytes];

        $path = $this->createPathForUpload();
        $context = stream_context_create([
            self::$streamWrapperProtocol => [
                'collectionWrapper' => $this->collectionWrapper,
                'filename' => $filename,
                'options' => $options,
            ],
        ]);

        return fopen($path, 'w', false, $context);
    }
public function openUploadStream($filename, array $options = [])
    {
        $options += ['chunkSizeBytes' => $this->chunkSizeBytes];

        $path = $this->createPathForUpload();
        $context = stream_context_create([
            self::$streamWrapperProtocol => [
                'collectionWrapper' => $this->collectionWrapper,
                'filename' => $filename,
                'options' => $options,
            ],
        ]);

        return fopen($path, 'w', false, $context);
    }
public function openUploadStream ( $ filename , array $ options = [ ] ) { $ options += [ 'chunkSizeBytes' => $ this -> chunkSizeBytes ] ; $ path = $ this -> createPathForUpload ( ) ; $ context = stream_context_create ( [ self :: $ streamWrapperProtocol => [ 'collectionWrapper' => $ this -> collectionWrapper , 'filename' => $ filename , 'options' => $ options , ] , ] ) ; return fopen ( $ path , 'w' , false , $ context ) ; }
Opens a writable stream for writing a GridFS file.

Supported options:

* _id (mixed): File document identifier. Defaults to a new ObjectId.

* chunkSizeBytes (integer): The chunk size in bytes. Defaults to the
bucket's chunk size.

* disableMD5 (boolean): When true, no MD5 sum will be generated for
the stored file. Defaults to "false".

* metadata (document): User data for the "metadata" field of the files
collection document.

@param string $filename Filename
@param array  $options  Upload options
@return resource
Opens a writable stream for writing a GridFS file .