title: Writing blobs to the blobstore
body: <p>I am trying to write to the blobstore using the method described here:</p>
  
  <p><a href="http://code.google.com/appengine/docs/python/blobstore/overview.html#Writing_Files_to_the_Blobstore" rel="nofollow">http://code.google.com/appengine/docs/python/blobstore/overview.html#Writing_Files_to_the_Blobstore</a></p>
  
  <p>I tried using the remote_api to execute the following code:</p>
  
  <pre><code>file_name = files.blobstore.create(mime_type='text/html',_blobinfo_uploaded_filename='sample.txt')
  with files.open(file_name, 'a') as f:
      f.write('sample text for the sample blob')
  files.finalize(file_name)
  </code></pre>
  
  <p>invariably raises the error (at the third line above):</p>
  
  <pre><code>Traceback (most recent call last):
    File "&lt;console&gt;", line 1, in &lt;module&gt;
    File "C:\Program Files (x86)\Google\google_appengine\google\appengine\api\file
  s\file.py", line 310, in write
      self._make_rpc_call_with_retry('Append', request, response)
    File "C:\Program Files (x86)\Google\google_appengine\google\appengine\api\file
  s\file.py", line 388, in _make_rpc_call_with_retry
      _make_call(method, request, response)
    File "C:\Program Files (x86)\Google\google_appengine\google\appengine\api\file
  s\file.py", line 236, in _make_call
      _raise_app_error(e)
    File "C:\Program Files (x86)\Google\google_appengine\google\appengine\api\file
  s\file.py", line 179, in _raise_app_error
      raise FileNotOpenedError()
  FileNotOpenedError
  </code></pre>
  
  <p>The file i am trying to write is very small (&lt; 20KB) so its not a quota issue.  Are there additional steps i am missing?</p>