lib/Beberlei/AzureBlobStorage/BlobClient.php
public function putBlobData($containerName = '', $blobName = '', $data = '', $metadata = array(), $leaseId = null, $additionalHeaders = array())
    {
        Assertion::notEmpty($containerName, 'Container name is not specified');
        self::assertValidContainerName($containerName);
        Assertion::notEmpty($blobName, 'Blob name is not specified.');
        self::assertValidRootContainerBlobName($containerName, $blobName);

        $headers = array();
        if (!is_null($leaseId)) {
            $headers['x-ms-lease-id'] = $leaseId;
        }
        $headers = array_merge($headers, $this->generateMetadataHeaders($metadata));

        foreach ($additionalHeaders as $key => $value) {
            $headers[$key] = $value;
        }

        $headers[Storage::PREFIX_STORAGE_HEADER . 'blob-type'] = self::BLOBTYPE_BLOCK;

        $resourceName = self::createResourceName($containerName , $blobName);

        $response = $this->performRequest($resourceName, array(), 'PUT', $headers, false, $data, self::RESOURCE_BLOB, self::PERMISSION_WRITE);
        if ( ! $response->isSuccessful()) {
            throw new BlobException($this->getErrorMessage($response, 'Resource could not be accessed.'));
        }

        return new BlobInstance(
            $containerName,
            $blobName,
            null,
            $response->getHeader('Etag'),
            $response->getHeader('Last-modified'),
            $this->getBaseUrl() . '/' . $containerName . '/' . $blobName,
            strlen($data),
                '',
                '',
                '',
            false,
            $metadata
        );
    }
public function putBlobData($containerName = '', $blobName = '', $data = '', $metadata = array(), $leaseId = null, $additionalHeaders = array())
    {
        Assertion::notEmpty($containerName, 'Container name is not specified');
        self::assertValidContainerName($containerName);
        Assertion::notEmpty($blobName, 'Blob name is not specified.');
        self::assertValidRootContainerBlobName($containerName, $blobName);

        $headers = array();
        if (!is_null($leaseId)) {
            $headers['x-ms-lease-id'] = $leaseId;
        }
        $headers = array_merge($headers, $this->generateMetadataHeaders($metadata));

        foreach ($additionalHeaders as $key => $value) {
            $headers[$key] = $value;
        }

        $headers[Storage::PREFIX_STORAGE_HEADER . 'blob-type'] = self::BLOBTYPE_BLOCK;

        $resourceName = self::createResourceName($containerName , $blobName);

        $response = $this->performRequest($resourceName, array(), 'PUT', $headers, false, $data, self::RESOURCE_BLOB, self::PERMISSION_WRITE);
        if ( ! $response->isSuccessful()) {
            throw new BlobException($this->getErrorMessage($response, 'Resource could not be accessed.'));
        }

        return new BlobInstance(
            $containerName,
            $blobName,
            null,
            $response->getHeader('Etag'),
            $response->getHeader('Last-modified'),
            $this->getBaseUrl() . '/' . $containerName . '/' . $blobName,
            strlen($data),
                '',
                '',
                '',
            false,
            $metadata
        );
    }
Put blob data

@param string $containerName      Container name
@param string $blobName           Blob name
@param mixed  $data               Data to store
@param array  $metadata           Key/value pairs of meta data
@param string $leaseId            Lease identifier
@param array  $additionalHeaders  Additional headers. See http://msdn.microsoft.com/en-us/library/dd179371.aspx for more information.
@return object Partial blob properties
@throws BlobException