Create a new MediaInMemoryUpload. DEPRECATED: Use MediaIoBaseUpload with either io.TextIOBase or io.StringIO for the stream. Args: body: string, Bytes of body content. mimetype: string, Mime-type of the file or default of 'application/octet-s
(
self,
body,
mimetype="application/octet-stream",
chunksize=DEFAULT_CHUNK_SIZE,
resumable=False,
)
| 635 | |
| 636 | @util.positional(2) |
| 637 | def __init__( |
| 638 | self, |
| 639 | body, |
| 640 | mimetype="application/octet-stream", |
| 641 | chunksize=DEFAULT_CHUNK_SIZE, |
| 642 | resumable=False, |
| 643 | ): |
| 644 | """Create a new MediaInMemoryUpload. |
| 645 | |
| 646 | DEPRECATED: Use MediaIoBaseUpload with either io.TextIOBase or io.StringIO for |
| 647 | the stream. |
| 648 | |
| 649 | Args: |
| 650 | body: string, Bytes of body content. |
| 651 | mimetype: string, Mime-type of the file or default of |
| 652 | 'application/octet-stream'. |
| 653 | chunksize: int, File will be uploaded in chunks of this many bytes. Only |
| 654 | used if resumable=True. |
| 655 | resumable: bool, True if this is a resumable upload. False means upload |
| 656 | in a single request. |
| 657 | """ |
| 658 | fd = io.BytesIO(body) |
| 659 | super(MediaInMemoryUpload, self).__init__( |
| 660 | fd, mimetype, chunksize=chunksize, resumable=resumable |
| 661 | ) |
| 662 | |
| 663 | |
| 664 | class MediaIoBaseDownload(object): |