private function openDownloadStreamByFile(stdClass $file)
    {
        $path = $this->createPathForFile($file);
        $context = stream_context_create([
            self::$streamWrapperProtocol => [
                'collectionWrapper' => $this->collectionWrapper,
                'file' => $file,
            ],
        ]);

        return fopen($path, 'r', false, $context);
    }
private function openDownloadStreamByFile(stdClass $file)
    {
        $path = $this->createPathForFile($file);
        $context = stream_context_create([
            self::$streamWrapperProtocol => [
                'collectionWrapper' => $this->collectionWrapper,
                'file' => $file,
            ],
        ]);

        return fopen($path, 'r', false, $context);
    }
private function openDownloadStreamByFile ( stdClass $ file ) { $ path = $ this -> createPathForFile ( $ file ) ; $ context = stream_context_create ( [ self :: $ streamWrapperProtocol => [ 'collectionWrapper' => $ this -> collectionWrapper , 'file' => $ file , ] , ] ) ; return fopen ( $ path , 'r' , false , $ context ) ; }
Opens a readable stream for the GridFS file.

@param stdClass $file GridFS file document
@return resource
Opens a readable stream for the GridFS file .