Retrieve image from meteor fil-collection package


#1

I am storing the images using meteor file-collection package. I can see the fs.files and fs.locks in robomongo.
Issue I am facing is to retrieve and display the images.

I searched but could only figure out that it could be done using image url which I am not clear with. Following entry is made into the db :

{
"_id" : ObjectId("10d2c609b8911ff5de60d710"),
"length" : 0,
"md5" : "d41d8cd98f00b204e9800998ecf8427e",
"uploadDate" : ISODate("2017-07-17T10:34:58.563Z"),
"chunkSize" : 2096128,
"filename" : "abc.jpeg",
"metadata" : {
    "owner" : "CE6zaYK79uxfdrgbR"
},
"aliases" : [],
"contentType" : "image"

}

Server code for db is as follows :

fc = new FileCollection('fs',  // base name of collection
{ resumable: false,          // Disable resumable.js upload support
resumableIndexName: undefined,    // Not used when resumable is false
chunkSize: 2*1024*1024 - 1024,    // Use 2MB chunks for gridFS and resumable
baseURL: '\gridfs\fs',     // Default base URL for all HTTP methods
locks: {                   // Parameters for gridfs-locks
  timeOut: 360,            // Seconds to wait for an unavailable lock
  pollingInterval: 5,      // Seconds to wait between lock attempts
  lockExpiration: 90       // Seconds until a lock expires
},
http: [ 
	{ method: 'get',
    path: '/:md5',  // this will be at route "/gridfs/myFiles/:md5"
    lookup: function (params, query) {  // uses express style url params
      return { md5: params.md5 };       // a query mapping url to myFiles
    }
  }
]    // HTTP method definitions, none by default

}
);