11
Views
5
Comments
Solved
[Azure Blob Storage] How to list files inside a directory?
Forge component by Barduino
Application Type
Traditional Web

I am trying to see if I can use this component in a project, but I am hitting a wall.

It seems I cannot list blobs inside a directory.

Example:

When I call the ListBlobs action, I see: my-directory, document.docx, and book.xls.

But now, I want to list the contents of my-directory and there is no action available to do that, is there?

The ListBlobs lists everything under my-container. If I want to go deeper in the nested folders I can't.


my-container/

├─ my-directory/

│  ├─ image-inside-directory.png

├─ document.docx

├─ book.xls


Thanks,

João Heleno

Solution

Hi João,

First of all. There are no directories or folder support in Azure Storage Accounts. What you think is an folder is nothing more then the name of a blob containing slashes. So an empty ListBlobs action should return all 3 files (and probably does) namely my-directory/image-inside-directory.png, document.docx and book.xls. 

You can use the Prefix parameter to start filtering blobs. So an value of "document" will return document.docx and a value of "my-directory" will return my-directory/image-inside-directory.png. 

Please note that in Azure Data Lake Gen 2 there is folder support but this component should not fully support that though.

Hope this helps,

Vincent

mvp_badge
MVP

Hi Vincent,

Thank you for your reply.

I realize that now. In the past, I worked with Azure File Share and I still had the "folder" concept in my mind.

Time to adapt.

Cheers,

João

mvp_badge
MVP

@Vincent Koning 

When I use slashes in my blobs, why don't I see the complete blob filename when calling the List action?

I uploaded a blob named "outsystems/file.txt" and when I list my container I am missing "file.txt"...

Without the full name I cannot use this component :) ... and I want to use it!!



Hi João,

That is strange and should not happen. Any change you can share your OML so I can take a look at it? Make sure to remove any connection strings before sharing!

Greetings,

Vincent

mvp_badge
MVP

Thank you for replying, Vincent.

I cannot upload the OML but, there is not much to see.

I pass the connection string, the container name, and the filename.



Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.