title: having trouble saving a file to MongoDB GridFS using mongoengine
body: <p>Edit: using python 2.7 on Windows 7</p>
  
  <p>I'm having trouble persisting data in a FileField using mongoengine.  The file size before &amp; after saving is drastically different.  Running this:</p>
  
  <pre><code>from mongoengine import *
  class Test(Document):
  
     File = FileField()
  
  #connect to my mongodb
  connect( 'myDB', host= '192.168.0.3' )
  
  Test.drop_collection()
  
  # write to mongodb GridFS, per the mongoengine documentation: https://mongoengine-odm.readthedocs.org/en/latest/guide/gridfs.html
  test = Test()
  test.File.put( open( r'c:\temp\owl.jpg', 'r') )
  test.save()
  
  #get the Test instance from the db, print out the number of bytes according to mongoengine
  test = Test.objects().first()
  print test.File.length
  
  #just to make sure we aren't crazy, check the filesize on disk:
  print os.path.getsize( r'c:\temp\owl.jpg' )
  </code></pre>
  
  <p>Generates this output:</p>
  
  <pre><code>864
  145047
  </code></pre>
  
  <p>Any pointers would be appreciated!</p>
  
  <ul>
  <li>btw, owl.jpg was saved from the following url in case you want to try to reproduce my example exactly:  <a href="http://getintobirds.audubon.org/sites/default/files/photos/wildlife_barn_owl.jpg" rel="nofollow">http://getintobirds.audubon.org/sites/default/files/photos/wildlife_barn_owl.jpg</a></li>
  </ul>