Skip to content
This repository was archived by the owner on May 7, 2024. It is now read-only.
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions storage/BlockBlobExample.php
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ function createContainerIfNotExists($blobRestProxy)
$counter = 1;
$blockIds = array();

while (!feof($handle))
while ($data = fread($handle, BLOCKSIZE))
{
$blockId = str_pad($counter, PADLENGTH, "0", STR_PAD_LEFT);
echo "Processing block $blockId.\n";
Expand All @@ -135,8 +135,6 @@ function createContainerIfNotExists($blobRestProxy)
$block->setType("Uncommitted");
array_push($blockIds, $block);

$data = fread($handle, BLOCKSIZE);

// Upload the block.
$blobRestProxy->createBlobBlock(CONTAINERNAME, BLOCKBLOBNAME, base64_encode($blockId), $data);
$counter++;
Expand Down Expand Up @@ -167,4 +165,4 @@ function createContainerIfNotExists($blobRestProxy)
echo "$code: $error_message";
}

?>
?>