![]() |
App Engine Python SDK
v1.6.9 rev.445
The Python runtime is available as an experimental Preview feature.
|
Public Member Functions | |
def | __init__ |
def | StoreBlob |
def | GenerateMIMEMessageString |
Class used for handling an upload post. The main interface to this class is the UploadCGI method. This will receive the upload form, store the blobs contained in the post and rewrite the blobs to contain BlobKeys instead of blobs.
def google.appengine.tools.dev_appserver_upload.UploadCGIHandler.__init__ | ( | self, | |
blob_storage, | |||
generate_blob_key = GenerateBlobKey , |
|||
now_func = datetime.datetime.now |
|||
) |
Constructor. Args: blob_storage: BlobStorage instance where actual blobs are stored. generate_blob_key: Function used for generating unique blob keys. now_func: Function that returns the current timestamp.
def google.appengine.tools.dev_appserver_upload.UploadCGIHandler.GenerateMIMEMessageString | ( | self, | |
form, | |||
boundary = None , |
|||
max_bytes_per_blob = None , |
|||
max_bytes_total = None , |
|||
bucket_name = None |
|||
) |
Generate a new post string from original form. Args: form: Instance of cgi.FieldStorage representing the whole form derived from original post data. boundary: Boundary to use for resulting form. Used only in tests so that the boundary is always consistent. max_bytes_per_blob: The maximum size in bytes that any single blob in the form is allowed to be. max_bytes_total: The maximum size in bytes that the total of all blobs in the form is allowed to be. bucket_name: The name of the Google Storage bucket to uplad the file. Returns: A string rendering of a MIMEMultipart instance.
def google.appengine.tools.dev_appserver_upload.UploadCGIHandler.StoreBlob | ( | self, | |
form_item, | |||
creation | |||
) |
Store form-item to blob storage. Args: form_item: FieldStorage instance that represents a specific form field. This instance should have a non-empty filename attribute, meaning that it is an uploaded blob rather than a normal form field. creation: Timestamp to associate with new blobs creation time. This parameter is provided so that all blobs in the same upload form can have the same creation date. Returns: datastore.Entity('__BlobInfo__') associated with the upload.