Phalcon\Db\Adapter\MongoDB\GridFS\Bucket::openUploadStream PHP Method

openUploadStream() public method

Supported options: * chunkSizeBytes (integer): The chunk size in bytes. Defaults to the bucket's chunk size.
public openUploadStream ( string $filename, array $options = [] ) : resource
$filename string Filename
$options array Upload options
return resource
    public function openUploadStream($filename, array $options = [])
    {
        $options += ['chunkSizeBytes' => $this->options['chunkSizeBytes']];
        $path = $this->createPathForUpload();
        $context = stream_context_create([self::$streamWrapperProtocol => ['collectionWrapper' => $this->collectionWrapper, 'filename' => $filename, 'options' => $options]]);
        return fopen($path, 'w', false, $context);
    }