我正在尝试使用 Azure CDN 服务,我在以下代码中遇到了此错误,我已经搜索了所有地方,但我没有在互联网或官方 Azure 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 />";
}
您可以在
SDK 安装WindowsAzure'Blob'Models
文件夹下找到CreateBlobOptions
类。链接到源代码:https://github.com/Azure/azure-sdk-for-php/blob/master/WindowsAzure/Blob/Models/CreateBlobOptions.php。
这是类所在:
https://github.com/Azure/azure-sdk-for-php/blob/master/WindowsAzure/Blob/Models/CreateBlobOptions.php