diff --git a/storage/google/cloud/storage/blob.py b/storage/google/cloud/storage/blob.py index 3bd9fe3edb0a..0b26781b06a4 100644 --- a/storage/google/cloud/storage/blob.py +++ b/storage/google/cloud/storage/blob.py @@ -919,10 +919,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(