我试图使用azure cdn服务,我在以下代码中遇到此错误,我已经到处搜索但我没有在互联网或官方天蓝色git呼吸中找到CreateBlobOption类或者在他们的网站上,帮助我,我坚持下去
<?php
require_once __DIR__.'/vendor/autoload.php';
use WindowsAzure\Common\ServicesBuilder;
use WindowsAzure\Common\ServiceException;
$connectionString = 'DefaultEndpointsProtocol=http;AccountName=myaccount;AccountKey=my_key';
$blobRestProxy = ServicesBuilder::getInstance()->createBlobService($connectionString);
$content = fopen('my_file.jpg','r');
$blob_name = 'my_file.jpg';
$options = new CreateBlobOptions();
$options->setBlobContentType('image/jpeg');
try
{
$blobRestProxy->createBlockBlob("images", $blob_name, $content,$options);
}
catch(ServiceException $e)
{
$code = $e->getCode();
$error_message = $e->getMessage();
echo $code.": ".$error_message."<br />";
}
答案 0 :(得分:1)
您可以在SDK安装中的CreateBlobOptions
文件夹下找到WindowsAzure\Blob\Models
课程。链接到源代码:https://github.com/Azure/azure-sdk-for-php/blob/master/WindowsAzure/Blob/Models/CreateBlobOptions.php。
答案 1 :(得分:1)