My favorites | Sign in
Project Home Downloads Wiki Issues Source
Search
for
StoreAPI  
This page describes the Store API
Featured, Phase-Implementation
Updated Aug 7, 2010 by sam.alba

Introduction

This page describes how to add big files on the Store WebService exactly in the same way of the admin panel.

This WebService has been developed to bypass the 1MB limit of appengine. It is not possible to dynamically cache objects with a size greater than 1MB, in this case, you need to store explicitly such an object using this WebService. It uses the Blobstore service, so file size cannot exceed 2GB.

Details

We assuming that the store WebService is mapped on /store/, which is the default value. So if you make your mapping on a different base URL, beware of the doc below.

Method Request URI Return Description
GET /_store/<new path>/new /_ah/upload/<unique id> Allocate a new upload point
POST | PUT /_ah/upload/<unique id> None Post the file to the previous allocated POST point
GET /_store/<new path> The file Fetch the uploaded file.
DELETE /_store/<new path> None Delete the uploaded file.

A request succeed if it returns a success HTTP code (2xx or 3xx).

Example

This example is real trace made on the development server.

Request

GET /_store/my/new/remote/file/new HTTP/1.1
Host: localhost:8080
Cookie: dev_appserver_login="test@example.com:True:185804764220139124118"

Response

HTTP/1.0 200 OK
Server: Development/1.0
Content-Length: 63

/_ah/upload/agdhcHBuYW1lchsLEhVfX0Jsb2JVcGxvYWRTZXNzaW9uX18YAQw

Request

POST /_ah/upload/agdhcHBuYW1lchsLEhVfX0Jsb2JVcGxvYWRTZXNzaW9uX18YAQw HTTP/1.1
Host: localhost:8080
Cookie: dev_appserver_login="test@example.com:True:185804764220139124118"
Content-Type: multipart/form-data; boundary=---------------------------567950583882997196254290631
Content-Length: 6963

<data multipart encoded>

Response

HTTP/1.0 302 
Server: Development/1.0
Content-Length: 0

I know this 302 response without "Location" is crappy, but this is mandatory to follow the Blobstore API.


Sign in to add a comment
Powered by Google Project Hosting