diff --git a/storage/google/cloud/storage/blob.py b/storage/google/cloud/storage/blob.py index 3691b0c8ba19..a782a7e4fa7d 100644 --- a/storage/google/cloud/storage/blob.py +++ b/storage/google/cloud/storage/blob.py @@ -790,10 +790,9 @@ def upload_from_string(self, data, content_type='text/plain', client=None): to the ``client`` stored on the blob's bucket. """ data = _to_bytes(data, encoding='utf-8') - string_buffer = BytesIO() - string_buffer.write(data) + string_buffer = BytesIO(data) self.upload_from_file( - file_obj=string_buffer, rewind=True, size=len(data), + file_obj=string_buffer, size=len(data), content_type=content_type, client=client) def create_resumable_upload_session(