robinrodricks / FluentStorage

A polycloud .NET cloud storage abstraction layer. Provides Blob storage (AWS S3, GCP, FTP, SFTP, Azure Blob/File/Event Hub/Data Lake) and Messaging (AWS SQS, Azure Queue/ServiceBus). Supports .NET 5+ and .NET Standard 2.0+. Pure C#.
MIT License
263 stars 33 forks source link

ZipFileBlobStorage puts "\" in front of entry #69

Closed gerrewsb closed 1 month ago

gerrewsb commented 1 month ago

Hi,

When using the ZipFileBlobStorage WriteAsync function it puts a "\" in front of the name of the entry. It doesn't matter if it's a file or a folder, it will always do it.

i think the bug is in StoragePath.Normalize(string, bool) it's called by the ZipFileBlobStorage with the bool set to false which makes it return the path prefixed with the PathSeparatorString (which is "\").

I have created my own ZipFileBlobStorage and copied yours in it, the only change i made is that i commented out the call to StoragePath.Normalize(string, bool). This fixed the bug and the folders/files are then created with the correct name.

With call to StoragePath.Normalize(string, bool) image

Without call to StoragePath.Normalize(string, bool) image