Please note that the contents of this offline web site may be out of date. To access the most recent documentation visit the online version .
Note that links that point to online resources are green in color and will open in a new window.
We would love it if you could give us feedback about this material by filling this form (You have to be online to fill it)



Blobstore Files API Functions

Deprecation Notice: The Files API and the functions described on this page are going to be removed at some time in the future. The documentation for the deprecated API is retained for the convenience of developers still using the feature.

The google.appengine.api.files.blobstore package provides the following functions:

create ( mime_type = application/octet-stream , _blobinfo_uploaded_filename = None )

Create a writable blobstore blob. You can use this method to create an empty file, and you can use the other functions in this package to get information about the file.

To work with this file, use the Files API in google.appengine.api.files.file . To write to this file, open it with the open() function from the Files API and then use the other Files API functions to manipulate it.

To read the file or obtain its blob key, finalize it using the Files API finalize() method and then call get_blob_key() .

Arguments

mime_type
A string providing the MIME type for content in the newly created blob.

Returns a filename for the blobstore file.

get_blob_key ( create_file_name )

Gets the blob key for a finalized blobstore file. To finalize the file, use the finalize() function in the Files API. This API is currently undocumented, but you can find the functions in the google.appengine.api.files.file package.

Arguments

create_file_name
The filename of the writable blobstore file returned by the create() function.

Returns a BlobKey instance

for the corresponding blob or None if the blob referred to by the file name is not finalized. Raises an InvalidFileNameError if the filename is not valid or is not finalized.
get_file_name ( blob_key )

Gets a filename based on the file's blob key .

Arguments

blob_key
The blob key for the writable blobstore file returned by the get_blob_key() function.

Returns the filename as string. You can pass this string to the Files API in order to read the file. This API is currently undocumented, but you can find the functions in the google.appengine.api.files.file package.

Authentication required

You need to be signed in with Google+ to do that.

Signing you in...

Google Developers needs your permission to do that.