• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1<?xml version="1.0" encoding="ascii"?>
2<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
3          "DTD/xhtml1-transitional.dtd">
4<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
5<head>
6  <title>googleapiclient.http.MediaIoBaseUpload</title>
7  <link rel="stylesheet" href="epydoc.css" type="text/css" />
8  <script type="text/javascript" src="epydoc.js"></script>
9</head>
10
11<body bgcolor="white" text="black" link="blue" vlink="#204080"
12      alink="#204080">
13<!-- ==================== NAVIGATION BAR ==================== -->
14<table class="navbar" border="0" width="100%" cellpadding="0"
15       bgcolor="#a0c0ff" cellspacing="0">
16  <tr valign="middle">
17  <!-- Home link -->
18      <th>&nbsp;&nbsp;&nbsp;<a
19        href="googleapiclient-module.html">Home</a>&nbsp;&nbsp;&nbsp;</th>
20
21  <!-- Tree link -->
22      <th>&nbsp;&nbsp;&nbsp;<a
23        href="module-tree.html">Trees</a>&nbsp;&nbsp;&nbsp;</th>
24
25  <!-- Index link -->
26      <th>&nbsp;&nbsp;&nbsp;<a
27        href="identifier-index.html">Indices</a>&nbsp;&nbsp;&nbsp;</th>
28
29  <!-- Help link -->
30      <th>&nbsp;&nbsp;&nbsp;<a
31        href="help.html">Help</a>&nbsp;&nbsp;&nbsp;</th>
32
33      <th class="navbar" width="100%"></th>
34  </tr>
35</table>
36<table width="100%" cellpadding="0" cellspacing="0">
37  <tr valign="top">
38    <td width="100%">
39      <span class="breadcrumbs">
40        <a href="googleapiclient-module.html">Package&nbsp;googleapiclient</a> ::
41        <a href="googleapiclient.http-module.html">Module&nbsp;http</a> ::
42        Class&nbsp;MediaIoBaseUpload
43      </span>
44    </td>
45    <td>
46      <table cellpadding="0" cellspacing="0">
47        <!-- hide/show private -->
48        <tr><td align="right"><span class="options">[<a href="javascript:void(0);" class="privatelink"
49    onclick="toggle_private();">hide&nbsp;private</a>]</span></td></tr>
50        <tr><td align="right"><span class="options"
51            >[<a href="frames.html" target="_top">frames</a
52            >]&nbsp;|&nbsp;<a href="googleapiclient.http.MediaIoBaseUpload-class.html"
53            target="_top">no&nbsp;frames</a>]</span></td></tr>
54      </table>
55    </td>
56  </tr>
57</table>
58<!-- ==================== CLASS DESCRIPTION ==================== -->
59<h1 class="epydoc">Class MediaIoBaseUpload</h1><p class="nomargin-top"><span class="codelink"><a href="googleapiclient.http-pysrc.html#MediaIoBaseUpload">source&nbsp;code</a></span></p>
60<center>
61<center>  <map id="uml_class_diagram_for_googleap_33" name="uml_class_diagram_for_googleap_33">
62<area shape="rect" id="node1_10" href="googleapiclient.http.MediaIoBaseUpload-class.html#__init__" title="Constructor." alt="" coords="17,115,519,135"/>
63<area shape="rect" id="node1_11" href="googleapiclient.http.MediaIoBaseUpload-class.html#chunksize" title="Chunk size for resumable uploads." alt="" coords="17,135,519,155"/>
64<area shape="rect" id="node1_12" href="googleapiclient.http.MediaIoBaseUpload-class.html#mimetype" title="Mime type of the body." alt="" coords="17,155,519,175"/>
65<area shape="rect" id="node1_13" href="googleapiclient.http.MediaIoBaseUpload-class.html#size" title="Size of upload." alt="" coords="17,175,519,195"/>
66<area shape="rect" id="node1_14" href="googleapiclient.http.MediaIoBaseUpload-class.html#resumable" title="Whether this upload is resumable." alt="" coords="17,195,519,215"/>
67<area shape="rect" id="node1_15" href="googleapiclient.http.MediaIoBaseUpload-class.html#getbytes" title="Get bytes from the media." alt="" coords="17,215,519,235"/>
68<area shape="rect" id="node1_16" href="googleapiclient.http.MediaIoBaseUpload-class.html#has_stream" title="Does the underlying upload support a streaming interface." alt="" coords="17,235,519,255"/>
69<area shape="rect" id="node1_17" href="googleapiclient.http.MediaIoBaseUpload-class.html#stream" title="A stream interface to the data being uploaded." alt="" coords="17,255,519,275"/>
70<area shape="rect" id="node1_18" href="googleapiclient.http.MediaIoBaseUpload-class.html#to_json" title="This upload type is not serializable." alt="" coords="17,275,519,295"/>
71<area shape="rect" id="node1" href="googleapiclient.http.MediaIoBaseUpload-class.html" title="A MediaUpload for a io.Base objects." alt="" coords="5,83,531,301"/>
72<area shape="rect" id="node2_19" href="googleapiclient.http.MediaUpload-class.html#new_from_json" title="Utility class method to instantiate a MediaUpload subclass from a JSON representation produced by to_json()." alt="" coords="200,37,335,57"/>
73<area shape="rect" id="node2" href="googleapiclient.http.MediaUpload-class.html" title="Describes a media object to upload." alt="" coords="187,5,346,64"/>
74</map>
75  <img src="uml_class_diagram_for_googleap_33.gif" alt='' usemap="#uml_class_diagram_for_googleap_33" ismap="ismap" class="graph-without-title" />
76</center>
77</center>
78<hr />
79<pre class="literalblock">
80A MediaUpload for a io.Base objects.
81
82Note that the Python file object is compatible with io.Base and can be used
83with this class also.
84
85  fh = BytesIO('...Some data to upload...')
86  media = MediaIoBaseUpload(fh, mimetype='image/png',
87    chunksize=1024*1024, resumable=True)
88  farm.animals().insert(
89      id='cow',
90      name='cow.png',
91      media_body=media).execute()
92
93Depending on the platform you are working on, you may pass -1 as the
94chunksize, which indicates that the entire file should be uploaded in a single
95request. If the underlying platform supports streams, such as Python 2.6 or
96later, then this can be very efficient as it avoids multiple connections, and
97also avoids loading the entire file into memory before sending it. Note that
98Google App Engine has a 5MB limit on request size, so you should never set
99your chunksize larger than 5MB, or to -1.
100
101</pre>
102
103<!-- ==================== INSTANCE METHODS ==================== -->
104<a name="section-InstanceMethods"></a>
105<table class="summary" border="1" cellpadding="3"
106       cellspacing="0" width="100%" bgcolor="white">
107<tr bgcolor="#70b0f0" class="table-header">
108  <td colspan="2" class="table-header">
109    <table border="0" cellpadding="0" cellspacing="0" width="100%">
110      <tr valign="top">
111        <td align="left"><span class="table-header">Instance Methods</span></td>
112        <td align="right" valign="top"
113         ><span class="options">[<a href="#section-InstanceMethods"
114         class="privatelink" onclick="toggle_private();"
115         >hide private</a>]</span></td>
116      </tr>
117    </table>
118  </td>
119</tr>
120<tr>
121    <td width="15%" align="right" valign="top" class="summary">
122      <span class="summary-type">&nbsp;</span>
123    </td><td class="summary">
124      <table width="100%" cellpadding="0" cellspacing="0" border="0">
125        <tr>
126          <td><span class="summary-sig"><a href="googleapiclient.http.MediaIoBaseUpload-class.html#__init__" class="summary-sig-name">__init__</a>(<span class="summary-sig-arg">self</span>,
127        <span class="summary-sig-arg">fd</span>,
128        <span class="summary-sig-arg">mimetype</span>,
129        <span class="summary-sig-arg">chunksize</span>=<span class="summary-sig-default">DEFAULT_CHUNK_SIZE</span>,
130        <span class="summary-sig-arg">resumable</span>=<span class="summary-sig-default">False</span>)</span><br />
131      Constructor.</td>
132          <td align="right" valign="top">
133            <span class="codelink"><a href="googleapiclient.http-pysrc.html#MediaIoBaseUpload.__init__">source&nbsp;code</a></span>
134
135          </td>
136        </tr>
137      </table>
138
139    </td>
140  </tr>
141<tr>
142    <td width="15%" align="right" valign="top" class="summary">
143      <span class="summary-type">&nbsp;</span>
144    </td><td class="summary">
145      <table width="100%" cellpadding="0" cellspacing="0" border="0">
146        <tr>
147          <td><span class="summary-sig"><a href="googleapiclient.http.MediaIoBaseUpload-class.html#chunksize" class="summary-sig-name">chunksize</a>(<span class="summary-sig-arg">self</span>)</span><br />
148      Chunk size for resumable uploads.</td>
149          <td align="right" valign="top">
150            <span class="codelink"><a href="googleapiclient.http-pysrc.html#MediaIoBaseUpload.chunksize">source&nbsp;code</a></span>
151
152          </td>
153        </tr>
154      </table>
155
156    </td>
157  </tr>
158<tr>
159    <td width="15%" align="right" valign="top" class="summary">
160      <span class="summary-type">&nbsp;</span>
161    </td><td class="summary">
162      <table width="100%" cellpadding="0" cellspacing="0" border="0">
163        <tr>
164          <td><span class="summary-sig"><a href="googleapiclient.http.MediaIoBaseUpload-class.html#mimetype" class="summary-sig-name">mimetype</a>(<span class="summary-sig-arg">self</span>)</span><br />
165      Mime type of the body.</td>
166          <td align="right" valign="top">
167            <span class="codelink"><a href="googleapiclient.http-pysrc.html#MediaIoBaseUpload.mimetype">source&nbsp;code</a></span>
168
169          </td>
170        </tr>
171      </table>
172
173    </td>
174  </tr>
175<tr>
176    <td width="15%" align="right" valign="top" class="summary">
177      <span class="summary-type">&nbsp;</span>
178    </td><td class="summary">
179      <table width="100%" cellpadding="0" cellspacing="0" border="0">
180        <tr>
181          <td><span class="summary-sig"><a href="googleapiclient.http.MediaIoBaseUpload-class.html#size" class="summary-sig-name">size</a>(<span class="summary-sig-arg">self</span>)</span><br />
182      Size of upload.</td>
183          <td align="right" valign="top">
184            <span class="codelink"><a href="googleapiclient.http-pysrc.html#MediaIoBaseUpload.size">source&nbsp;code</a></span>
185
186          </td>
187        </tr>
188      </table>
189
190    </td>
191  </tr>
192<tr>
193    <td width="15%" align="right" valign="top" class="summary">
194      <span class="summary-type">&nbsp;</span>
195    </td><td class="summary">
196      <table width="100%" cellpadding="0" cellspacing="0" border="0">
197        <tr>
198          <td><span class="summary-sig"><a href="googleapiclient.http.MediaIoBaseUpload-class.html#resumable" class="summary-sig-name">resumable</a>(<span class="summary-sig-arg">self</span>)</span><br />
199      Whether this upload is resumable.</td>
200          <td align="right" valign="top">
201            <span class="codelink"><a href="googleapiclient.http-pysrc.html#MediaIoBaseUpload.resumable">source&nbsp;code</a></span>
202
203          </td>
204        </tr>
205      </table>
206
207    </td>
208  </tr>
209<tr>
210    <td width="15%" align="right" valign="top" class="summary">
211      <span class="summary-type">&nbsp;</span>
212    </td><td class="summary">
213      <table width="100%" cellpadding="0" cellspacing="0" border="0">
214        <tr>
215          <td><span class="summary-sig"><a href="googleapiclient.http.MediaIoBaseUpload-class.html#getbytes" class="summary-sig-name">getbytes</a>(<span class="summary-sig-arg">self</span>,
216        <span class="summary-sig-arg">begin</span>,
217        <span class="summary-sig-arg">length</span>)</span><br />
218      Get bytes from the media.</td>
219          <td align="right" valign="top">
220            <span class="codelink"><a href="googleapiclient.http-pysrc.html#MediaIoBaseUpload.getbytes">source&nbsp;code</a></span>
221
222          </td>
223        </tr>
224      </table>
225
226    </td>
227  </tr>
228<tr>
229    <td width="15%" align="right" valign="top" class="summary">
230      <span class="summary-type">&nbsp;</span>
231    </td><td class="summary">
232      <table width="100%" cellpadding="0" cellspacing="0" border="0">
233        <tr>
234          <td><span class="summary-sig"><a href="googleapiclient.http.MediaIoBaseUpload-class.html#has_stream" class="summary-sig-name">has_stream</a>(<span class="summary-sig-arg">self</span>)</span><br />
235      Does the underlying upload support a streaming interface.</td>
236          <td align="right" valign="top">
237            <span class="codelink"><a href="googleapiclient.http-pysrc.html#MediaIoBaseUpload.has_stream">source&nbsp;code</a></span>
238
239          </td>
240        </tr>
241      </table>
242
243    </td>
244  </tr>
245<tr>
246    <td width="15%" align="right" valign="top" class="summary">
247      <span class="summary-type">&nbsp;</span>
248    </td><td class="summary">
249      <table width="100%" cellpadding="0" cellspacing="0" border="0">
250        <tr>
251          <td><span class="summary-sig"><a href="googleapiclient.http.MediaIoBaseUpload-class.html#stream" class="summary-sig-name">stream</a>(<span class="summary-sig-arg">self</span>)</span><br />
252      A stream interface to the data being uploaded.</td>
253          <td align="right" valign="top">
254            <span class="codelink"><a href="googleapiclient.http-pysrc.html#MediaIoBaseUpload.stream">source&nbsp;code</a></span>
255
256          </td>
257        </tr>
258      </table>
259
260    </td>
261  </tr>
262<tr>
263    <td width="15%" align="right" valign="top" class="summary">
264      <span class="summary-type">&nbsp;</span>
265    </td><td class="summary">
266      <table width="100%" cellpadding="0" cellspacing="0" border="0">
267        <tr>
268          <td><span class="summary-sig"><a href="googleapiclient.http.MediaIoBaseUpload-class.html#to_json" class="summary-sig-name">to_json</a>(<span class="summary-sig-arg">self</span>)</span><br />
269      This upload type is not serializable.</td>
270          <td align="right" valign="top">
271            <span class="codelink"><a href="googleapiclient.http-pysrc.html#MediaIoBaseUpload.to_json">source&nbsp;code</a></span>
272
273          </td>
274        </tr>
275      </table>
276
277    </td>
278  </tr>
279  <tr>
280    <td colspan="2" class="summary">
281    <div class="private">    <p class="indent-wrapped-lines"><b>Inherited from <code><a href="googleapiclient.http.MediaUpload-class.html">MediaUpload</a></code></b> (private):
282      <code><a href="googleapiclient.http.MediaUpload-class.html#_to_json" onclick="show_private();">_to_json</a></code>
283      </p></div>
284    <p class="indent-wrapped-lines"><b>Inherited from <code>object</code></b>:
285      <code>__delattr__</code>,
286      <code>__format__</code>,
287      <code>__getattribute__</code>,
288      <code>__hash__</code>,
289      <code>__new__</code>,
290      <code>__reduce__</code>,
291      <code>__reduce_ex__</code>,
292      <code>__repr__</code>,
293      <code>__setattr__</code>,
294      <code>__sizeof__</code>,
295      <code>__str__</code>,
296      <code>__subclasshook__</code>
297      </p>
298    </td>
299  </tr>
300</table>
301<!-- ==================== CLASS METHODS ==================== -->
302<a name="section-ClassMethods"></a>
303<table class="summary" border="1" cellpadding="3"
304       cellspacing="0" width="100%" bgcolor="white">
305<tr bgcolor="#70b0f0" class="table-header">
306  <td colspan="2" class="table-header">
307    <table border="0" cellpadding="0" cellspacing="0" width="100%">
308      <tr valign="top">
309        <td align="left"><span class="table-header">Class Methods</span></td>
310        <td align="right" valign="top"
311         ><span class="options">[<a href="#section-ClassMethods"
312         class="privatelink" onclick="toggle_private();"
313         >hide private</a>]</span></td>
314      </tr>
315    </table>
316  </td>
317</tr>
318  <tr>
319    <td colspan="2" class="summary">
320    <p class="indent-wrapped-lines"><b>Inherited from <code><a href="googleapiclient.http.MediaUpload-class.html">MediaUpload</a></code></b>:
321      <code><a href="googleapiclient.http.MediaUpload-class.html#new_from_json">new_from_json</a></code>
322      </p>
323    </td>
324  </tr>
325</table>
326<!-- ==================== PROPERTIES ==================== -->
327<a name="section-Properties"></a>
328<table class="summary" border="1" cellpadding="3"
329       cellspacing="0" width="100%" bgcolor="white">
330<tr bgcolor="#70b0f0" class="table-header">
331  <td colspan="2" class="table-header">
332    <table border="0" cellpadding="0" cellspacing="0" width="100%">
333      <tr valign="top">
334        <td align="left"><span class="table-header">Properties</span></td>
335        <td align="right" valign="top"
336         ><span class="options">[<a href="#section-Properties"
337         class="privatelink" onclick="toggle_private();"
338         >hide private</a>]</span></td>
339      </tr>
340    </table>
341  </td>
342</tr>
343  <tr>
344    <td colspan="2" class="summary">
345    <p class="indent-wrapped-lines"><b>Inherited from <code>object</code></b>:
346      <code>__class__</code>
347      </p>
348    </td>
349  </tr>
350</table>
351<!-- ==================== METHOD DETAILS ==================== -->
352<a name="section-MethodDetails"></a>
353<table class="details" border="1" cellpadding="3"
354       cellspacing="0" width="100%" bgcolor="white">
355<tr bgcolor="#70b0f0" class="table-header">
356  <td colspan="2" class="table-header">
357    <table border="0" cellpadding="0" cellspacing="0" width="100%">
358      <tr valign="top">
359        <td align="left"><span class="table-header">Method Details</span></td>
360        <td align="right" valign="top"
361         ><span class="options">[<a href="#section-MethodDetails"
362         class="privatelink" onclick="toggle_private();"
363         >hide private</a>]</span></td>
364      </tr>
365    </table>
366  </td>
367</tr>
368</table>
369<a name="__init__"></a>
370<div>
371<table class="details" border="1" cellpadding="3"
372       cellspacing="0" width="100%" bgcolor="white">
373<tr><td>
374  <table width="100%" cellpadding="0" cellspacing="0" border="0">
375  <tr valign="top"><td>
376  <h3 class="epydoc"><span class="sig"><span class="sig-name">__init__</span>(<span class="sig-arg">self</span>,
377        <span class="sig-arg">fd</span>,
378        <span class="sig-arg">mimetype</span>,
379        <span class="sig-arg">chunksize</span>=<span class="sig-default">DEFAULT_CHUNK_SIZE</span>,
380        <span class="sig-arg">resumable</span>=<span class="sig-default">False</span>)</span>
381    <br /><em class="fname">(Constructor)</em>
382  </h3>
383  </td><td align="right" valign="top"
384    ><span class="codelink"><a href="googleapiclient.http-pysrc.html#MediaIoBaseUpload.__init__">source&nbsp;code</a></span>&nbsp;
385    </td>
386  </tr></table>
387
388  <pre class="literalblock">
389Constructor.
390
391Args:
392  fd: io.Base or file object, The source of the bytes to upload. MUST be
393    opened in blocking mode, do not use streams opened in non-blocking mode.
394    The given stream must be seekable, that is, it must be able to call
395    seek() on fd.
396  mimetype: string, Mime-type of the file.
397  chunksize: int, File will be uploaded in chunks of this many bytes. Only
398    used if resumable=True. Pass in a value of -1 if the file is to be
399    uploaded as a single chunk. Note that Google App Engine has a 5MB limit
400    on request size, so you should never set your chunksize larger than 5MB,
401    or to -1.
402  resumable: bool, True if this is a resumable upload. False means upload
403    in a single request.
404
405</pre>
406  <dl class="fields">
407    <dt>Decorators:</dt>
408    <dd><ul class="nomargin-top">
409        <li><code>@util.positional(3)</code></li>
410    </ul></dd>
411    <dt>Overrides:
412        object.__init__
413    </dt>
414  </dl>
415</td></tr></table>
416</div>
417<a name="chunksize"></a>
418<div>
419<table class="details" border="1" cellpadding="3"
420       cellspacing="0" width="100%" bgcolor="white">
421<tr><td>
422  <table width="100%" cellpadding="0" cellspacing="0" border="0">
423  <tr valign="top"><td>
424  <h3 class="epydoc"><span class="sig"><span class="sig-name">chunksize</span>(<span class="sig-arg">self</span>)</span>
425  </h3>
426  </td><td align="right" valign="top"
427    ><span class="codelink"><a href="googleapiclient.http-pysrc.html#MediaIoBaseUpload.chunksize">source&nbsp;code</a></span>&nbsp;
428    </td>
429  </tr></table>
430
431  <pre class="literalblock">
432Chunk size for resumable uploads.
433
434Returns:
435  Chunk size in bytes.
436
437</pre>
438  <dl class="fields">
439    <dt>Overrides:
440        <a href="googleapiclient.http.MediaUpload-class.html#chunksize">MediaUpload.chunksize</a>
441    </dt>
442  </dl>
443</td></tr></table>
444</div>
445<a name="mimetype"></a>
446<div>
447<table class="details" border="1" cellpadding="3"
448       cellspacing="0" width="100%" bgcolor="white">
449<tr><td>
450  <table width="100%" cellpadding="0" cellspacing="0" border="0">
451  <tr valign="top"><td>
452  <h3 class="epydoc"><span class="sig"><span class="sig-name">mimetype</span>(<span class="sig-arg">self</span>)</span>
453  </h3>
454  </td><td align="right" valign="top"
455    ><span class="codelink"><a href="googleapiclient.http-pysrc.html#MediaIoBaseUpload.mimetype">source&nbsp;code</a></span>&nbsp;
456    </td>
457  </tr></table>
458
459  <pre class="literalblock">
460Mime type of the body.
461
462Returns:
463  Mime type.
464
465</pre>
466  <dl class="fields">
467    <dt>Overrides:
468        <a href="googleapiclient.http.MediaUpload-class.html#mimetype">MediaUpload.mimetype</a>
469    </dt>
470  </dl>
471</td></tr></table>
472</div>
473<a name="size"></a>
474<div>
475<table class="details" border="1" cellpadding="3"
476       cellspacing="0" width="100%" bgcolor="white">
477<tr><td>
478  <table width="100%" cellpadding="0" cellspacing="0" border="0">
479  <tr valign="top"><td>
480  <h3 class="epydoc"><span class="sig"><span class="sig-name">size</span>(<span class="sig-arg">self</span>)</span>
481  </h3>
482  </td><td align="right" valign="top"
483    ><span class="codelink"><a href="googleapiclient.http-pysrc.html#MediaIoBaseUpload.size">source&nbsp;code</a></span>&nbsp;
484    </td>
485  </tr></table>
486
487  <pre class="literalblock">
488Size of upload.
489
490Returns:
491  Size of the body, or None of the size is unknown.
492
493</pre>
494  <dl class="fields">
495    <dt>Overrides:
496        <a href="googleapiclient.http.MediaUpload-class.html#size">MediaUpload.size</a>
497    </dt>
498  </dl>
499</td></tr></table>
500</div>
501<a name="resumable"></a>
502<div>
503<table class="details" border="1" cellpadding="3"
504       cellspacing="0" width="100%" bgcolor="white">
505<tr><td>
506  <table width="100%" cellpadding="0" cellspacing="0" border="0">
507  <tr valign="top"><td>
508  <h3 class="epydoc"><span class="sig"><span class="sig-name">resumable</span>(<span class="sig-arg">self</span>)</span>
509  </h3>
510  </td><td align="right" valign="top"
511    ><span class="codelink"><a href="googleapiclient.http-pysrc.html#MediaIoBaseUpload.resumable">source&nbsp;code</a></span>&nbsp;
512    </td>
513  </tr></table>
514
515  <pre class="literalblock">
516Whether this upload is resumable.
517
518Returns:
519  True if resumable upload or False.
520
521</pre>
522  <dl class="fields">
523    <dt>Overrides:
524        <a href="googleapiclient.http.MediaUpload-class.html#resumable">MediaUpload.resumable</a>
525    </dt>
526  </dl>
527</td></tr></table>
528</div>
529<a name="getbytes"></a>
530<div>
531<table class="details" border="1" cellpadding="3"
532       cellspacing="0" width="100%" bgcolor="white">
533<tr><td>
534  <table width="100%" cellpadding="0" cellspacing="0" border="0">
535  <tr valign="top"><td>
536  <h3 class="epydoc"><span class="sig"><span class="sig-name">getbytes</span>(<span class="sig-arg">self</span>,
537        <span class="sig-arg">begin</span>,
538        <span class="sig-arg">length</span>)</span>
539  </h3>
540  </td><td align="right" valign="top"
541    ><span class="codelink"><a href="googleapiclient.http-pysrc.html#MediaIoBaseUpload.getbytes">source&nbsp;code</a></span>&nbsp;
542    </td>
543  </tr></table>
544
545  <pre class="literalblock">
546Get bytes from the media.
547
548Args:
549  begin: int, offset from beginning of file.
550  length: int, number of bytes to read, starting at begin.
551
552Returns:
553  A string of bytes read. May be shorted than length if EOF was reached
554  first.
555
556</pre>
557  <dl class="fields">
558    <dt>Overrides:
559        <a href="googleapiclient.http.MediaUpload-class.html#getbytes">MediaUpload.getbytes</a>
560    </dt>
561  </dl>
562</td></tr></table>
563</div>
564<a name="has_stream"></a>
565<div>
566<table class="details" border="1" cellpadding="3"
567       cellspacing="0" width="100%" bgcolor="white">
568<tr><td>
569  <table width="100%" cellpadding="0" cellspacing="0" border="0">
570  <tr valign="top"><td>
571  <h3 class="epydoc"><span class="sig"><span class="sig-name">has_stream</span>(<span class="sig-arg">self</span>)</span>
572  </h3>
573  </td><td align="right" valign="top"
574    ><span class="codelink"><a href="googleapiclient.http-pysrc.html#MediaIoBaseUpload.has_stream">source&nbsp;code</a></span>&nbsp;
575    </td>
576  </tr></table>
577
578  <pre class="literalblock">
579Does the underlying upload support a streaming interface.
580
581Streaming means it is an io.IOBase subclass that supports seek, i.e.
582seekable() returns True.
583
584Returns:
585  True if the call to stream() will return an instance of a seekable io.Base
586  subclass.
587
588</pre>
589  <dl class="fields">
590    <dt>Overrides:
591        <a href="googleapiclient.http.MediaUpload-class.html#has_stream">MediaUpload.has_stream</a>
592    </dt>
593  </dl>
594</td></tr></table>
595</div>
596<a name="stream"></a>
597<div>
598<table class="details" border="1" cellpadding="3"
599       cellspacing="0" width="100%" bgcolor="white">
600<tr><td>
601  <table width="100%" cellpadding="0" cellspacing="0" border="0">
602  <tr valign="top"><td>
603  <h3 class="epydoc"><span class="sig"><span class="sig-name">stream</span>(<span class="sig-arg">self</span>)</span>
604  </h3>
605  </td><td align="right" valign="top"
606    ><span class="codelink"><a href="googleapiclient.http-pysrc.html#MediaIoBaseUpload.stream">source&nbsp;code</a></span>&nbsp;
607    </td>
608  </tr></table>
609
610  <pre class="literalblock">
611A stream interface to the data being uploaded.
612
613Returns:
614  The returned value is an io.IOBase subclass that supports seek, i.e.
615  seekable() returns True.
616
617</pre>
618  <dl class="fields">
619    <dt>Overrides:
620        <a href="googleapiclient.http.MediaUpload-class.html#stream">MediaUpload.stream</a>
621    </dt>
622  </dl>
623</td></tr></table>
624</div>
625<a name="to_json"></a>
626<div>
627<table class="details" border="1" cellpadding="3"
628       cellspacing="0" width="100%" bgcolor="white">
629<tr><td>
630  <table width="100%" cellpadding="0" cellspacing="0" border="0">
631  <tr valign="top"><td>
632  <h3 class="epydoc"><span class="sig"><span class="sig-name">to_json</span>(<span class="sig-arg">self</span>)</span>
633  </h3>
634  </td><td align="right" valign="top"
635    ><span class="codelink"><a href="googleapiclient.http-pysrc.html#MediaIoBaseUpload.to_json">source&nbsp;code</a></span>&nbsp;
636    </td>
637  </tr></table>
638
639  <pre class="literalblock">
640This upload type is not serializable.
641
642</pre>
643  <dl class="fields">
644    <dt>Overrides:
645        <a href="googleapiclient.http.MediaUpload-class.html#to_json">MediaUpload.to_json</a>
646    </dt>
647  </dl>
648</td></tr></table>
649</div>
650<br />
651<!-- ==================== NAVIGATION BAR ==================== -->
652<table class="navbar" border="0" width="100%" cellpadding="0"
653       bgcolor="#a0c0ff" cellspacing="0">
654  <tr valign="middle">
655  <!-- Home link -->
656      <th>&nbsp;&nbsp;&nbsp;<a
657        href="googleapiclient-module.html">Home</a>&nbsp;&nbsp;&nbsp;</th>
658
659  <!-- Tree link -->
660      <th>&nbsp;&nbsp;&nbsp;<a
661        href="module-tree.html">Trees</a>&nbsp;&nbsp;&nbsp;</th>
662
663  <!-- Index link -->
664      <th>&nbsp;&nbsp;&nbsp;<a
665        href="identifier-index.html">Indices</a>&nbsp;&nbsp;&nbsp;</th>
666
667  <!-- Help link -->
668      <th>&nbsp;&nbsp;&nbsp;<a
669        href="help.html">Help</a>&nbsp;&nbsp;&nbsp;</th>
670
671      <th class="navbar" width="100%"></th>
672  </tr>
673</table>
674<table border="0" cellpadding="0" cellspacing="0" width="100%%">
675  <tr>
676    <td align="left" class="footer">
677    Generated by Epydoc 3.0.1 on Fri Jun 14 15:57:28 2019
678    </td>
679    <td align="right" class="footer">
680      <a target="mainFrame" href="http://epydoc.sourceforge.net"
681        >http://epydoc.sourceforge.net</a>
682    </td>
683  </tr>
684</table>
685
686<script type="text/javascript">
687  <!--
688  // Private objects are initially displayed (because if
689  // javascript is turned off then we want them to be
690  // visible); but by default, we want to hide them.  So hide
691  // them unless we have a cookie that says to show them.
692  checkCookie();
693  // -->
694</script>
695</body>
696</html>
697