Permalink
Browse files

建立 Blob

  • Loading branch information...
1 parent 4ad0836 commit c9345c5b913c082588e55fe080b2bf8f0c545d17 Sam.IO.Hsiao committed Aug 14, 2016
Showing with 19 additions and 0 deletions.
  1. +19 −0 app/Services/AzureBlobService.php
@@ -38,4 +38,23 @@ public function createContainer(string $containerName) : bool
return true;
}
+
+ /**
+ * 建立 Blob
+ * @param string $containerName
+ * @param string $blobName
+ * @param $content
+ * @return bool
+ */
+ public function createBlob(string $containerName, string $blobName, $content) : bool
+ {
+ try {
+ $this->blobProxy->createBlockBlob($containerName, $blobName, $content);
+ } catch (ServiceException $exception) {
+ echo $exception->getCode() . ':' . $exception->getMessage();
+ return false;
+ }
+
+ return true;
+ }
}

0 comments on commit c9345c5

Please sign in to comment.