$name = "win.jpg"; $blob = $blobRestProxy->deleteBlob("pictures",$name);
<?php require_once "WindowsAzure/WindowsAzure.php"; require_once 'PHPUnit\autoload.php'; use WindowsAzure\Common\ServicesBuilder; use WindowsAzure\Common\ServiceException; // Create Connection String $connectionString = "DefaultEndpointsProtocol=http;AccountName=[yourAccount];AccountKey=[yourKey]"; // Create blob REST proxy. $blobRestProxy = ServicesBuilder::getInstance()->createBlobService($connectionString); try { // List blobs. $blob_list = $blobRestProxy->listBlobs("pictures"); $blobs = $blob_list->getBlobs(); echo "<table width=\"400\" border=\"1\" cellspacing=\"0\" cellpadding=\"0\">"; foreach($blobs as $blob) { echo " <tr> <td width=\"100\">".$blob->getName()."</td> <td width=\"200\"><img src='".$blob->getUrl()."'></td> <td width=\"100\"><a href=\"phpAzureBlob2.php?blobName=".$blob->getName()."\">Delete</a></td> </tr> "; } echo "</table>"; } catch(ServiceException $e){ // Handle exception based on error codes and messages. // Error codes and messages are here: // http://msdn.microsoft.com/en-us/library/windowsazure/dd179439.aspx $code = $e->getCode(); $error_message = $e->getMessage(); echo $code.": ".$error_message."<br />"; } $blobRestProxy = null; ?>
<?php require_once "WindowsAzure/WindowsAzure.php"; require_once 'PHPUnit\autoload.php'; use WindowsAzure\Common\ServicesBuilder; use WindowsAzure\Common\ServiceException; // Create Connection String $connectionString = "DefaultEndpointsProtocol=http;AccountName=[yourAccount];AccountKey=[yourKey]"; // Create blob REST proxy. $blobRestProxy = ServicesBuilder::getInstance()->createBlobService($connectionString); try { // Get blob. $name = $_GET["blobName"]; $blob = $blobRestProxy->deleteBlob("pictures",$name); } catch(ServiceException $e){ // Handle exception based on error codes and messages. // Error codes and messages are here: // http://msdn.microsoft.com/en-us/library/windowsazure/dd179439.aspx $code = $e->getCode(); $error_message = $e->getMessage(); echo $code.": ".$error_message."<br />"; } $blobRestProxy = null; ?>
ช่วยกันสนับสนุนรักษาเว็บไซต์ความรู้แห่งนี้ไว้ด้วยการสนับสนุน Source Code 2.0 ของทีมงานไทยครีเอท