class documentation
class MediaInMemoryUpload(MediaIoBaseUpload):
Constructor: MediaInMemoryUpload(body, mimetype, chunksize, resumable)
MediaUpload for a chunk of bytes.
DEPRECATED: Use MediaIoBaseUpload with either io.TextIOBase or io.StringIO for the stream.
| Method | __init__ |
Create a new MediaInMemoryUpload. |
Inherited from MediaIoBaseUpload:
| Method | chunksize |
Chunk size for resumable uploads. |
| Method | getbytes |
Get bytes from the media. |
| Method | has |
Does the underlying upload support a streaming interface. |
| Method | mimetype |
Mime type of the body. |
| Method | resumable |
Whether this upload is resumable. |
| Method | size |
Size of upload. |
| Method | stream |
A stream interface to the data being uploaded. |
| Method | to |
This upload type is not serializable. |
| Instance Variable | _chunksize |
Undocumented |
| Instance Variable | _fd |
Undocumented |
| Instance Variable | _mimetype |
Undocumented |
| Instance Variable | _resumable |
Undocumented |
| Instance Variable | _size |
Undocumented |
Inherited from MediaUpload (via MediaIoBaseUpload):
| Class Method | new |
Utility class method to instantiate a MediaUpload subclass from a JSON representation produced by to_json(). |
| Method | _to |
Utility function for creating a JSON representation of a MediaUpload. |
@util.positional( 2)
def __init__(self, body, mimetype='application/octet-stream', chunksize=DEFAULT_CHUNK_SIZE, resumable=False): ¶
def __init__(self, body, mimetype='application/octet-stream', chunksize=DEFAULT_CHUNK_SIZE, resumable=False): ¶
Create a new MediaInMemoryUpload.
DEPRECATED: Use MediaIoBaseUpload with either io.TextIOBase or io.StringIO for the stream.
| Parameters | |
| body | string, Bytes of body content. |
| mimetype | string, Mime-type of the file or default of 'application/octet-stream'. |
| 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. |