简体   繁体   中英

Azure List Blob by prefix in php sdk

I use azure php sdk to use azure blob service.Right now ,I can create blob, list blob ,delete blob.But I would like to list blob by prefix.

My container name is products. In the products ,I create images. I gave the name of images.

  • small/image1_small.jpg.
  • medium/image1_medium.jpg.

Is it possible to list blob by blob name prefix?I found for C#. But I couldn't find for php.Any help would be much appreciated.

Based on the source code for listing blobs on GitHub , you could specify various listing options, one of them is blob prefix. So you would do something like:

$blobListOptions = new ListBlobsOptions();
$blobListOptions->setPrefix('abc/');
$result = $blobRestProxy->listBlobs('container name', $blobListOptions);

You can find source code for ListBlobsOptions here: https://github.com/Azure/azure-sdk-for-php/blob/master/WindowsAzure/Blob/Models/ListBlobsOptions.php

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM