unosquare / embedio

A tiny, cross-platform, module based web server for .NET
http://unosquare.github.io/embedio
Other
1.47k stars 176 forks source link

Using .WithZipFile and .WithZipFileStream sometimes gives System.IO.IOException #419

Closed simohr closed 4 years ago

simohr commented 4 years ago

When starting WebServer with a zip file I sometimes get this exception System.IO.IOException. Sometimes it works as expected and loads all files. Sometimes I get this exception and sometimes it loads the server but with some files missing (local header corrupted). I am attempting to run the server on a Xamarin.Android app. Any help would be appreciated.

geoperez commented 4 years ago

Hi.

Do you have a similar issue with Windows or Linux?

simohr commented 4 years ago

I am using Macos Catalina(10.15.2) and Visual Studio for Mac (8.3.11). I would also like to note that when testing the WebServer on a simple Console App it could not open zip files created with the Mac system(Archive Utiliy or Keka), however I suppose this has more to do with System.IO.Compression.

rdeago commented 4 years ago

According to the results of a quick Google search there seem to be some long-standing bugs in MacOS's ZIP archiving utilities. I don't know if this completely explains the problems @simohr is experiencing, but I'd suggest using ZIP files created on a Windows or Linux system, or at least verify that a ZIP file can be correctly extracted on a Windows or Linux system before using it with EmbedIO - or with System.IO.Compression at all.

rdeago commented 4 years ago

@simohr can you confirm that the problem goes away if all involved Zip files were created on other systems? If so, can we close this issue?

simohr commented 4 years ago

Yes, using zip files from other systems works fine.