Skip to content

Commit

Permalink
Adds matching doc changes
Browse files Browse the repository at this point in the history
  • Loading branch information
ebozduman committed Jul 9, 2018
1 parent cce8f8b commit 6e18f51
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 14 deletions.
16 changes: 9 additions & 7 deletions docs/API.md
Original file line number Diff line number Diff line change
Expand Up @@ -788,18 +788,20 @@ The maximum size of a single object is limited to 5TB. put_object transparently
import os
# Put a file with default content-type, upon success prints the etag identifier computed by server.
try:
file_stat = os.stat('my-testfile')
file_data = open('my-testfile', 'rb')
print(minioClient.put_object('mybucket', 'myobject', file_data, file_stat.st_size))
with open('my-testfile', 'rb') as file_data:
file_stat = os.stat('my-testfile')
print(minioClient.put_object('mybucket', 'myobject',
file_data, file_stat.st_size))
except ResponseError as err:
print(err)

# Put a file with 'application/csv'.
try:
file_stat = os.stat('my-testfile.csv')
file_data = open('my-testfile.csv', 'rb')
minioClient.put_object('mybucket', 'myobject.csv', file_data,
file_stat.st_size, content_type='application/csv')
with open('my-testfile.csv', 'rb') as file_data:
file_stat = os.stat('my-testfile.csv')
minioClient.put_object('mybucket', 'myobject.csv', file_data,
file_stat.st_size, content_type='application/csv')

except ResponseError as err:
print(err)
```
Expand Down
15 changes: 8 additions & 7 deletions docs/zh_CN/API.md
Original file line number Diff line number Diff line change
Expand Up @@ -742,18 +742,19 @@ __示例__
import os
# Put a file with default content-type, upon success prints the etag identifier computed by server.
try:
file_stat = os.stat('my-testfile')
file_data = open('my-testfile', 'rb')
print(minioClient.put_object('mybucket', 'myobject', file_data, file_stat.st_size))
with open('my-testfile', 'rb') as file_data:
file_stat = os.stat('my-testfile')
print(minioClient.put_object('mybucket', 'myobject',
file_data, file_stat.st_size))
except ResponseError as err:
print(err)

# Put a file with 'application/csv'.
try:
file_stat = os.stat('my-testfile.csv')
file_data = open('my-testfile.csv', 'rb')
minioClient.put_object('mybucket', 'myobject.csv', file_data,
file_stat.st_size, content_type='application/csv')
with open('my-testfile.csv', 'rb') as file_data:
file_stat = os.stat('my-testfile.csv')
minioClient.put_object('mybucket', 'myobject.csv', file_data,
file_stat.st_size, content_type='application/csv')
except ResponseError as err:
print(err)
```
Expand Down

0 comments on commit 6e18f51

Please sign in to comment.