title: How to download files stored in monogdb with gridfs using spring mvs
body: <p>I have saved a file into mongoDB using gridFS like so.</p>
  
  <pre><code>    Mongo mongo = new Mongo("XXXXX", XXXX);
      DB db = mongo.getDB("XXX");
      GridFS fs = new GridFS(XXX);
  
      File install = new File("C:\\Users\\Nabeel\\Desktop\\docs.txt");
      GridFSInputFile inFile = fs.createFile(install);
      inFile.save();
  </code></pre>
  
  <p>Now I want download that file using spring MVC. I don't seep to able to find example on how i can get the file back as gridFS has converted the file into binary.</p>
  
  <p>An example code would be nice as i am new to all this.</p>
  
  <p>Thanks you in advance  </p>