Master's Castle

  • Home
  • About
Twitter Facebook RSS

Writing Files to GAE Blobstore

Posted on February 8, 2013
No CommentsLeave a comment

FileSystem API was introduced in AppEngine last year. A great feature. I tried using it more than a couple of times and ended up with one problem or the other. Some of the notable issues include:

  • What should be the filename during create and save? The name given during create was only name-part and cannot be used during read. Read must use fullpath.
  • If you use fullpath, you cannot use it to delete the file.

After a bunch of experiments, I concluded that it is best to use BlobKey.


As a contribution, I have published the code that would help you out working with the low-level API at Github – https://github.com/gvaish/gae-utils/. The actual class – BlobstoreFS – is available here.

The following methods are available:

  • save: To save contents to a file. You can either provide BlobKey of an existing file if you wish to overwrite the contents.
  • delete: Delete the file, along with the associated BlobKey.
  • open: Gives you InputStream for you to be able to read the raw contents
  • readToEnd: Returns String containing the file contents.

Share this:

Categories: Google App Engine (GAE) | Tags: GAE, Google App Engine, Library, Technology
Notice: This work is licensed under a BY-NC-SA. Permalink: Writing Files to GAE Blobstore
Book: Getting Started with NoSQL
Architecture for Multi-device Applications: Part 3 – Consumption Channel
Cancel Reply
  • Authored Books

  • Recent Posts

    • TodoMVC using Mojito, Part 2: Common affinity controller
    • TodoMVC using Mojito, Part 1: Common affinity controller
    • Todo MVC using Mojito
    • Book: Getting Started with NoSQL
    • Writing Files to GAE Blobstore
  • Links

    • My Previous Website – www.mastergaurav.com
    • Search Me – @Google
    • Search Me – @Yahoo!
    • Slideshare – My Slides
    • You Tube – Tech Videos
  • Open Source

    • Android MVC
    • Me on CodeProject
    • Me on Github
    • Me on Google Code
    • Me on SourceForge
  • Social Presence

    • Facebook
    • Google+
    • Quora
    • Twitter
  • Tags

    Architecture Authoring Blog Engine Book CSS3 Framework GAE Google App Engine HTML5 JavaScript Library Maths Minow Mobile Mojito MVC Node Nodester NoSQL Technology TodoMVC Tutorial Vedic Maths Web Wordpress Yahoo
  • Categories

    • Architecture
    • Google App Engine (GAE)
    • Minow
    • Mojito
    • Nodester
    • NoSQL
    • Vedic Maths
    • Wordpress
  • History

    February 2013
    M T W T F S S
    « Aug   Apr »
     123
    45678910
    11121314151617
    18192021222324
    25262728  
© Gaurav Vaish. All rights reserved.
The views presented here are personal, do not necessarily reflect that of my employer.
Proudly Powered by WordPress | Nest Theme by YChong