Click or drag to resize
GridFSBucket.DownloadToStream Method (BsonValue, Stream, GridFSDownloadOptions, CancellationToken)
Downloads a file stored in GridFS and writes the contents to a stream.

Namespace: MongoDB.Driver.GridFS
Assembly: MongoDB.Driver.GridFS (in MongoDB.Driver.GridFS.dll) Version: 2.4.1
Syntax
public void DownloadToStream(
	BsonValue id,
	Stream destination,
	GridFSDownloadOptions options = null,
	CancellationToken cancellationToken = null
)

Parameters

id
Type: MongoDB.Bson.BsonValue
The file id.
destination
Type: System.IO.Stream
The destination.
options (Optional)
Type: MongoDB.Driver.GridFS.GridFSDownloadOptions
The options.
cancellationToken (Optional)
Type: System.Threading.CancellationToken
The cancellation token.
See Also