openUploadStream

Opens a Stream that the application can write the contents of the file to.

As the application writes the contents to the returned Stream, the contents are uploaded as chunks in the chunks collection. When
the application signals it is done writing the contents of the file by calling close on the returned Stream, a files collection
document is created in the files collection.

Parameters:

filename - the filename for the stream

Returns:

the GridFSUploadStream that provides the ObjectId for the file to be uploaded and the Stream to which the
application will write the contents.

openUploadStream

Opens a Stream that the application can write the contents of the file to.

As the application writes the contents to the returned Stream, the contents are uploaded as chunks in the chunks collection. When
the application signals it is done writing the contents of the file by calling close on the returned Stream, a files collection
document is created in the files collection.

Parameters:

filename - the filename for the stream

options - the GridFSUploadOptions

Returns:

the GridFSUploadStream that provides the ObjectId for the file to be uploaded and the Stream to which the
application will write the contents.

openUploadStream

Opens a Stream that the application can write the contents of the file to.

As the application writes the contents to the returned Stream, the contents are uploaded as chunks in the chunks collection. When
the application signals it is done writing the contents of the file by calling close on the returned Stream, a files collection
document is created in the files collection.

Parameters:

id - the custom id value of the file

filename - the filename for the stream

Returns:

the GridFSUploadStream that provides the ObjectId for the file to be uploaded and the Stream to which the
application will write the contents.

Since:

3.3

openUploadStream

Opens a Stream that the application can write the contents of the file to.

As the application writes the contents to the returned Stream, the contents are uploaded as chunks in the chunks collection. When
the application signals it is done writing the contents of the file by calling close on the returned Stream, a files collection
document is created in the files collection.

Parameters:

id - the custom id value of the file

filename - the filename for the stream

options - the GridFSUploadOptions

Returns:

the GridFSUploadStream that includes the _id for the file to be uploaded and the Stream to which the
application will write the contents.

Since:

3.3

uploadFromStream

Reads the contents of the user file from the Stream and uploads it as chunks in the chunks collection. After all the
chunks have been uploaded, it creates a files collection document for filename in the files collection.

Parameters:

filename - the filename for the stream

source - the Stream providing the file data

Returns:

the ObjectId of the uploaded file.

uploadFromStream

Reads the contents of the user file from the Stream and uploads it as chunks in the chunks collection. After all the
chunks have been uploaded, it creates a files collection document for filename in the files collection.

Parameters:

filename - the filename for the stream

source - the Stream providing the file data

options - the GridFSUploadOptions

Returns:

the ObjectId of the uploaded file.

uploadFromStream

Reads the contents of the user file from the Stream and uploads it as chunks in the chunks collection. After all the
chunks have been uploaded, it creates a files collection document for filename in the files collection.

Parameters:

id - the custom id value of the file

filename - the filename for the stream

source - the Stream providing the file data

Since:

3.3

uploadFromStream

Reads the contents of the user file from the Stream and uploads it as chunks in the chunks collection. After all the
chunks have been uploaded, it creates a files collection document for filename in the files collection.