This project is read-only.

Getting Started

Back to Getting Started.
Back to Blob storage.

Blob storage stream wrapper

The Windows Azure SDK for PHP provides support for registering a blob storage client as a PHP file stream wrapper. The blob storage stream wrapper provides support for using regular file operations on Windows Azure Blob Storage. For example, one can open a file from Windows Azure Blob Storage with the fopen() function:

$fileHandle = fopen('azure://mycontainer/myfile.txt', 'r');

// ...


In order to do this, the Windows Azure SDK for PHP blob storage client must be registered as a stream wrapper. This can be done by calling the registerStreamWrapper() function:

/** Microsoft_WindowsAzure_Storage_Blob */
require_once 'Microsoft/WindowsAzure/Storage/Blob.php';

$storageClient = new Microsoft_WindowsAzure_Storage_Blob();
$storageClient->registerStreamWrapper(); // registers azure:// on this storage client

// or:

$storageClient->registerStreamWrapper('blob://'); // regiters blob:// on this storage client

To unregister the stream wrapper, the unregisterStreamWrapper() function can be used.

Last edited Sep 10, 2009 at 8:27 AM by maartenba, version 3


No comments yet.