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

uploadFromStream() public method

Supported options: * chunkSizeBytes (integer): The chunk size in bytes. Defaults to the bucket's chunk size.
public uploadFromStream ( string $filename, resource $source, array $options = [] ) : MongoDB\BSON\ObjectId
$filename string Filename
$source resource Readable stream
$options array Stream options
return MongoDB\BSON\ObjectId ID of the newly created GridFS file
    public function uploadFromStream($filename, $source, array $options = [])
    {
        $options += ['chunkSizeBytes' => $this->options['chunkSizeBytes']];
        $stream = new WritableStream($this->collectionWrapper, $filename, $options);
        return $stream->uploadFromStream($source);
    }