Method UploadFromStream
UploadFromStream(string, Stream, GridFSUploadOptions, CancellationToken)
Uploads a file (or a new revision of a file) to GridFS.
public ObjectId UploadFromStream(string filename, Stream source, GridFSUploadOptions options = null, CancellationToken cancellationToken = default)
Parameters
filenamestringThe filename.
sourceStreamThe source.
optionsGridFSUploadOptionsThe options.
cancellationTokenCancellationTokenThe cancellation token.
Returns
- ObjectId
The id of the new file.