| Trees | Indices | Help |
|---|
|
|
A MediaUpload for a file.
Construct a MediaFileUpload and pass as the media_body parameter of the
method. For example, if we had a service that allowed uploading images:
media = MediaFileUpload('smiley.png', mimetype='image/png',
chunksize=1024*1024, resumable=True)
service.objects().insert(
bucket=buckets['items'][0]['id'],
name='smiley.png',
media_body=media).execute()
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
Inherited from Inherited from |
|||
|
|||
|
Inherited from |
|||
|
|||
|
|||
|
|||
|
Inherited from |
|||
|
|||
Constructor.
Args:
filename: string, Name of the file.
mimetype: string, Mime-type of the file. If None then a mime-type will be
guessed from the file extension.
chunksize: int, File will be uploaded in chunks of this many bytes. Only
used if resumable=True.
resumable: bool, True if this is a resumable upload. False means upload
in a single request.
|
Chunk size for resumable uploads. Returns: Chunk size in bytes.
|
Mime type of the body. Returns: Mime type.
|
Size of upload. Returns: Size of the body, or None of the size is unknown.
|
Whether this upload is resumable. Returns: True if resumable upload or False.
|
Get bytes from the media. Args: begin: int, offset from beginning of file. length: int, number of bytes to read, starting at begin. Returns: A string of bytes read. May be shorted than length if EOF was reached first.
|
Creating a JSON representation of an instance of Credentials. Returns: string, a JSON representation of this instance, suitable to pass to from_json().
|
| Trees | Indices | Help |
|---|
| Generated by Epydoc 3.0.1 on Thu Jun 14 08:01:56 2012 | http://epydoc.sourceforge.net |