Added functions for converting files to mongodb