PHP on Azure: how to list blobs in a 'folder' -
i'm trying list blobs contained in 'accidentsphoto' 'folder' located @ root of blob container:
// list blobs. $key = 'accidentsphoto'; $bloblistoptions = new listblobsoptions(); $bloblistoptions->setprefix($key); $bloblistoptions->setdelimiter("/"); $bloblist = $blobrestproxy->listblobs($blobcontainer, $bloblistoptions); foreach($bloblist->getblobprefixes() $key => $blob) { echo "blobprefix ".$key.": \t".$blob->getname()."\n"; } foreach($bloblist->getblobs() $key => $blob) { echo "blob ".$key.": \t".$blob->getname()."\t(".$blob->geturl().")\n"; } alas, key listed follows:
set-cookie: xxxx date: tue, 15 aug 2017 12:42:28 gmt connection: keep-alive blobprefix 0: accidentsphoto/
you'll need remove following line list blobs.
$bloblistoptions->setdelimiter("/");
Comments
Post a Comment