Table of Contents

Method DownloadAsBytesAsync

Namespace
MongoDB.Driver.GridFS
Assembly
MongoDB.Driver.GridFS.dll

DownloadAsBytesAsync(BsonValue, GridFSDownloadOptions, CancellationToken)

Downloads a file stored in GridFS and returns it as a byte array.

public Task<byte[]> DownloadAsBytesAsync(BsonValue id, GridFSDownloadOptions options = null, CancellationToken cancellationToken = default)

Parameters

id BsonValue

The file id.

options GridFSDownloadOptions

The options.

cancellationToken CancellationToken

The cancellation token.

Returns

Task<byte[]>

A Task whose result is a byte array containing the contents of the file stored in GridFS.