Description Usage Arguments Value See Also Examples
Store a file into a GridFS on a MongoDB server. This function stores the entire given file on the server, breaking it up into 256K chunks as necessary.
1 | mongo.gridfs.store.file(gridfs, filename, remotename = "", contenttype = "")
|
gridfs |
A (mongo.gridfs) object. |
filename |
(string) The path/filename of the file to copy to the server. |
remotename |
(string) The name the file will be known as within the
GridFS. |
contenttype |
(string) Optional MIME content type. |
TRUE, if successful; FALSE, if an error occured during the operation.
mongo.gridfs,
mongo.gridfs.create
,
mongo.gridfs.remove.file
.
1 2 3 4 5 6 7 | mongo <- mongo.create()
if (mongo.is.connected(mongo)) {
gridfs <- mongo.gridfs.create(mongo, "grid")
# Copy a local file to the server as a gridfs file
mongo.gridfs.store.file(gridfs, "tests/test.R", "test.R")
mongo.gridfs.destroy(gridfs)
}
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.