Azure PUT BlockList returns 400(块 ID 无效。块 ID 必须经过 base64 编码。)
Azure PUT BlockList returns 400 (Block ID is invalid. Block ID must be base64 encoded.)
我有一个似乎非常简单的测试,可以将大文件上传到 Azure Blob 存储。
我得到的响应是 400:
400(区块ID无效。区块ID必须是base64编码。)
我上传的URL是:https://xxxx.blob.core.windows.net/tmp/af620cd8-.....&comp=blocklist
与正文:
<?xml version="1.0" encoding="utf-8"?>
<BlockList>
<Latest>BLOCK0</Latest>
<Latest>BLOCK1</Latest>
</BlockList>
这是在几次成功上传块之后出现的:
https://xxxx.blob.core.windows.net/tmp/af620cd8-02e0-fee2....&blockid=BLOCK0
等等
似乎这里的任何内容都不需要 Base64 编码,并且块 ID 的大小完全相同(另一个 post 中提到的内容)。还有什么我可以在这里尝试的吗?
完整代码在这里:
https://github.com/mikebz/azureupload
而具体的前端文件在这里:
https://github.com/mikebz/azureupload/blob/master/formfileupload/templates/chunked.html
块 ID 必须采用 base64 编码,因为您没有这样做,所以会收到此错误。
来自 Put Block
REST API 文档:
blockid: Required. A valid Base64 string value that identifies the
block. Prior to encoding, the string must be less than or equal to 64
bytes in size. For a given blob, the length of the value specified for
the blockid parameter must be the same size for each block. Note that
the Base64 string must be URL-encoded.
我有一个似乎非常简单的测试,可以将大文件上传到 Azure Blob 存储。
我得到的响应是 400: 400(区块ID无效。区块ID必须是base64编码。)
我上传的URL是:https://xxxx.blob.core.windows.net/tmp/af620cd8-.....&comp=blocklist
与正文:
<?xml version="1.0" encoding="utf-8"?>
<BlockList>
<Latest>BLOCK0</Latest>
<Latest>BLOCK1</Latest>
</BlockList>
这是在几次成功上传块之后出现的: https://xxxx.blob.core.windows.net/tmp/af620cd8-02e0-fee2....&blockid=BLOCK0 等等
似乎这里的任何内容都不需要 Base64 编码,并且块 ID 的大小完全相同(另一个 post 中提到的内容)。还有什么我可以在这里尝试的吗?
完整代码在这里: https://github.com/mikebz/azureupload 而具体的前端文件在这里: https://github.com/mikebz/azureupload/blob/master/formfileupload/templates/chunked.html
块 ID 必须采用 base64 编码,因为您没有这样做,所以会收到此错误。
来自 Put Block
REST API 文档:
blockid: Required. A valid Base64 string value that identifies the block. Prior to encoding, the string must be less than or equal to 64 bytes in size. For a given blob, the length of the value specified for the blockid parameter must be the same size for each block. Note that the Base64 string must be URL-encoded.