Table of Contents

Method DownloadAsBytesByNameAsync

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

DownloadAsBytesByNameAsync(string, GridFSDownloadByNameOptions, CancellationToken)

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

Task<byte[]> DownloadAsBytesByNameAsync(string filename, GridFSDownloadByNameOptions options = null, CancellationToken cancellationToken = default)

Parameters

filename string

The filename.

options GridFSDownloadByNameOptions

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.