Skip to content

AWS ListBlobsAsync trims first letter of object key when listing root of bucket #43

@DanielHarman

Description

@DanielHarman

I'm currently trying to list files that are just contained in the root of a bucket in S3.

var listBlobsAsync = await _storageProvider.ListBlobsAsync("");

I expect to get a list of BlobDescriptors with the keys file1.txt, file2.txt and file3.txt for example but instead get ile1.txt, ile2.txt and ile3.txt

The problem occurs here because even when an empty string is provided, it will always trim at least one character.

Name = entry.Key.Remove(0, containerName.Length + 1),

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions