Skip to content
This repository has been archived by the owner on Nov 27, 2023. It is now read-only.

Fatal Error while uploading files bigger than 4GB #740

Closed
thorstenchristiansen opened this issue Apr 27, 2015 · 1 comment
Closed

Fatal Error while uploading files bigger than 4GB #740

thorstenchristiansen opened this issue Apr 27, 2015 · 1 comment

Comments

@thorstenchristiansen
Copy link

When uploading large files to the blob-storage, I get the following error:
Fatal error: Uncaught exception 'WindowsAzure\Common\ServiceException' with message 'Fail:
Code: 400
Value: The specified blob or block content is invalid.

The issue is, that the string-length of the block-Id gets bigger when 1000 chunks are uploaded.
With a maximum chunk-size of 4MB this means, that no files bigger than 3996MB can be uploaded.

The problem can be solved by editing the WindowsAzure/Blob/BlobRestProxy.php.
In the function createBlockBlob() there is a line to set the block-Id:

$block->setBlockId(base64_encode(str_pad($counter++, '0', 6)));

Changing it to:

$block->setBlockId(base64_encode(str_pad($counter++, 6, '0', STR_PAD_LEFT)));

solved the problem for me.

@yaqiyang
Copy link
Member

@thorstenchristiansen , this has been fixed by #757. Please let us know if you still see issues.

thanks
Yaqi

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants