0

我正在尝试将文本文件写入 blob。我知道我必须创建一个容器和一个 blob。我需要写这样的东西:

$text = 'some text';
$myFile = "file.txt";
$fh = fopen($myFile, 'w') or die("can't open file c");
fwrite($fh, $json);
fclose($fh);

问题是我想编写这个 php 脚本但使用 blob(我们无权访问系统文件)我该怎么做?

4

1 回答 1

1

将文件保存到磁盘后,您需要将其上传到容器:

_storageClient->putBlob('mycontainer', 'file.txt', 'file.txt');

您可以使用 Windows Azure PHP SDK 来做到这一点。按照本教程了解更多信息:将 Blob 放入 Blob 容器中

于 2012-05-31T13:24:36.750 回答