title: MongoDB GridFS - Is it filename or fileName
body: <p>Please look at the following image, from <a href="http://mongoexplorer.com/" rel="nofollow noreferrer">http://mongoexplorer.com/</a>:</p>
  
  <p><img src="https://i.stack.imgur.com/WVYAH.png" alt="http://mongoexplorer.com/"></p>
  
  <p>I've been trying to work through GridFS, referencing <a href="https://github.com/jamescarr/nodejs-mongodb-streaming" rel="nofollow noreferrer">https://github.com/jamescarr/nodejs-mongodb-streaming</a>. The files I uploaded, come back nicely and the stream that comes back via the following get function looks right.</p>
  
  <pre><code>var gridfs = (function () {
      function gridfs() { }
      gridfs.get = function (id, fn) {
          var db, store;
          db = mongoose.connection.db;
          id = new ObjectID(id);
          store = new GridStore(db, id, "r", {
              root: "fs"
          });
          return store.open(function (err, store) {
              if (err) {
                  return fn(err);
              }
              return fn(null, store);
          });
      };
      return gridfs;
  })();
  </code></pre>
  
  <p>Using <a href="http://mongoexplorer.com/" rel="nofollow noreferrer">http://mongoexplorer.com/</a> I uploaded files into GridFS to test with, but they seem broken when I use the node code above to retrieve them.</p>
  
  <p>That is when I noticed the filename / fileName thing. Looking here <strong>/node_modules/mongodb/lib/mongodb/gridfs/gridstore.js</strong> I saw the reference to filename with a lowercase 'N', but in my GridFS, it's fileName with a capital 'N'. </p>
  
  <p>OK, so just for kicks, I changed it to lowercase in GridFS, but I still get some corruption in the stream (node code above) when retrieving files uploaded with <a href="http://mongoexplorer.com/" rel="nofollow noreferrer">http://mongoexplorer.com/</a>.
  Clicking <strong>Save as...</strong> in <a href="http://mongoexplorer.com/" rel="nofollow noreferrer">http://mongoexplorer.com/</a>, however brings back my fine just perfectly.</p>
  
  <p>To get back to my question, (since my tests didn't seem to prove anything,) I am wondering which is it:  filename with a lowercase 'N', or fileName with 'N' in caps?</p>