Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ZipArchive bug when filename being archived has trailing spaces at the end #4161

ModestasK opened this issue Jan 13, 2020 · 0 comments


Copy link

@ModestasK ModestasK commented Jan 13, 2020

Code: (System.IO.Compression.ZipFile.dll | v2.2.8)

using (var arch = new ZipArchive(fs, ZipArchiveMode.Create))
           arch.CreateEntryFromFile("some_data.csv  ", ""); // note the trailing spaces in source filename


  1. When running this on Linux - everything is ok. The extracted file has a good name.
  2. When running on Windows - the extracted file has __ at the end (spaces turned into _). So in my case extracting I get some_data.csv__
    Odd thing is that looking into the archive file with archive manager such as 7z shows as if it's some_data.csv inside, but after extracting the file has underscores at the end.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
1 participant
You can’t perform that action at this time.