Method UploadFromBytes
| MongoDB CSharp Driver API Reference (original) (raw)
Namespace
Assembly
MongoDB.Driver.dll
UploadFromBytes(string, byte[], GridFSUploadOptions, CancellationToken)
Uploads a file (or a new revision of a file) to GridFS.
public ObjectId UploadFromBytes(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
The id of the new file.