1
我想上傳一個二進制文件,我必須Openstack Swift。這個文件的大小是129MB。我使用的是Python的客戶端上傳:上傳二進制文件到Openstack Swift給出錯誤
swift_client = swiftclient.Connection(preauthurl=swift_public_auth_url,preauthtoken=swift_access_token,auth_version="2.0",insecure=True,tenant_name="admin")
with open("/path/to/file/file.ckpt", 'r') as read_file:
swift_client.put_object(swift_container_name, 'file.ckpt', contents= read_file.read(),content_type='text/plain')
print "done"
這引發以下錯誤:
Traceback (most recent call last):
File "<stdin>", line 2, in <module>
File "/usr/local/lib/python2.7/dist-packages/swiftclient/client.py", line 1824, in put_object
response_dict=response_dict)
File "/usr/local/lib/python2.7/dist-packages/swiftclient/client.py", line 1673, in _retry
service_token=self.service_token, **kwargs)
File "/usr/local/lib/python2.7/dist-packages/swiftclient/client.py", line 1322, in put_object
raise ClientException.from_response(resp, 'Object PUT failed', body)
swiftclient.exceptions.ClientException: Object PUT failed: https://abc.xyz/swift/v1/AUTH_123456789abcdefghijklmn/container/file.ckpt 413 Request Entity Too Large [first 60 chars of response] <html>
<head><title>413 Request Entity Too Large</title></h
然而,當我試圖用空白文本文件test.txt替換test.ckpt,它得到了上傳具有相同的參數。我知道這個錯誤發生在文件大小大於5GB的時候,但是這裏有什麼問題?