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.6.0+Branch.origin/v2.6.x.Sha.593796a7b35dc59243383bcc684de296a5468f2e
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