Hi Gaurhari,
GridFS does indeed store the image broken up over a number of documents in mongodb.
When you wish to store an object as a GridFS document in Mongo you would call the gridFS storeFile function which has two modes:
First is to load and store the file from an existing file in the OS
Second is to load and store the file from a given array of data and the length of this data
This second method should be what you are looking for.
Please note that the API doc's aren't clear, you need to provide a fileName when using the second method so that gridFS has a file name reference for each image.
Cheers,
David
On Wednesday, September 5, 2012 9:56:20 PM UTC+10, gaur hari wrote:
Hi David,
Is there any way to convert images into binary form and store that in mongodb in c++ because in gridfs i need to define location of image but in case I am providing database as sevice to deive and I want to upload image from client and save into database.how will I achieve that.??