Table of Contents

Method UploadFromBytesAsync

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

UploadFromBytesAsync(string, byte[], GridFSUploadOptions, CancellationToken)

Uploads a file (or a new revision of a file) to GridFS.

Task<ObjectId> UploadFromBytesAsync(string filename, byte[] source, GridFSUploadOptions options = null, CancellationToken cancellationToken = default)

Parameters

filename string

The filename.

source byte[]

The source.

options GridFSUploadOptions

The options.

cancellationToken CancellationToken

The cancellation token.

Returns

Task<ObjectId>

A Task whose result is the id of the new file.