Method DownloadAsBytes
DownloadAsBytes(BsonValue, GridFSDownloadOptions, CancellationToken)
Downloads a file stored in GridFS and returns it as a byte array.
public byte[] DownloadAsBytes(BsonValue id, GridFSDownloadOptions options = null, CancellationToken cancellationToken = default)
Parameters
idBsonValueThe file id.
optionsGridFSDownloadOptionsThe options.
cancellationTokenCancellationTokenThe cancellation token.
Returns
- byte[]
A byte array containing the contents of the file stored in GridFS.