public function write($key, $content)
{
$this->init();
try {
$options = new CreateBlobOptions();
if ($this->detectContentType) {
$fileInfo = new \finfo(FILEINFO_MIME_TYPE);
$contentType = $fileInfo->buffer($content);
$options->setContentType($contentType);
}
$this->blobProxy->createBlockBlob($this->containerName, $key, $content, $options);
return Util\Size::fromContent($content);
} catch (ServiceException $e) {
$this->failIfContainerNotFound($e, sprintf('write content for key "%s"', $key));
return false;
}
}