0
我正在使用PHP將文件複製到Azure服務上。是否有可能生成一個鏈接,允許用戶使用Office 365在線自動打開此存儲的文檔?目前,返回URL將存儲的文檔下載到用戶本地存儲。這裏是我使用Microsoft Azure PHP SDK的PHP代碼。是否可以使用Office 365在線打開存儲在Azure上的文檔?
require_once 'vendor/autoload.php';
use WindowsAzure\Common\ServicesBuilder;
use MicrosoftAzure\Storage\Common\ServiceException;
// Create blob REST proxy.
$connectionString="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx";
$blobRestProxy = ServicesBuilder::getInstance()->createBlobService($connectionString);
$content = fopen("demo.doc", "r");
$blob_name = "demo.doc";
try {
//Upload blob
$blobRestProxy->createBlockBlob("mycontainer", $blob_name, $content);
}
catch(ServiceException $e){
// Handle exception based on error codes and messages.
// Error codes and messages are here:
// http://msdn.microsoft.com/library/azure/dd179439.aspx
$code = $e->getCode();
$error_message = $e->getMessage();
echo $code.": ".$error_message."<br />";
}