Error when extracting from a dotnetzip created zip file - "Windows cannot complete the extraction."

StackOverflow https://stackoverflow.com/questions/17863601

  •  04-06-2022
  •  | 
  •  

I'm using dotnetzip to create a zip file on the fly to be returned via mvc as a stream.

I'm able to add files which are already streams, ie a file created on the fly. I'm also adding files created from base64 strings.

Creating and downloading the zip file is fine, when i open the zip file using windows explorer (windows 7 or 8) i can see all of the entries as expected. Opening the file created from a memorystream opens without issue, but when i try to open the file created from a base64 string, windows explorer returns the error

Windows cannot complete the extraction. The destination file could not be created.

If i try to drag a file from the zip file in windows explorer to another folder, i get the error:

enter image description here

If i open the same zip file or extract using WinRAR and open any of the entries i don't have any issues.

Any ideas? I'm thinking maybe i need to add a content type to the base64 string or stream maybe? Dotnetzip doesn't seem to have a parameter to specify content types...

I've made sure there's no encryption on the zip file or any of it's entries

有帮助吗?

解决方案

It appears that you're trying to extract and save a file that has colons in the file name (the name in your screen shot "Attachment 2 - 25-07-2013 15:27:04..png"). That's not going to work. You need to make sure that the file names in your zip file don't contain invalid file name characters.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top