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

How to unzip bundling zip files and there are no filename postfix with .zip? #120

Closed
YuYin opened this issue Dec 24, 2019 · 10 comments
Closed
Assignees
Labels
new-feature New feature or request resolved

Comments

@YuYin
Copy link

YuYin commented Dec 24, 2019

zipped files like this: test.zip.001,test.zip.002,test.zip.003

@srikanth-lingala
Copy link
Owner

Splitting zip files this way (.zip.001, .zip.002, etc) is not according to the formal zip specification. A split zip according to zip specification has the format .z01, .z02....., .zip. This type of split zip files is supported by zip4j. The one you asked is a custom split format used by some tools (I think 7zip splits it this way). At the moment zip4j does not support that format.

@YuYin
Copy link
Author

YuYin commented Dec 26, 2019

Yes,I got it. As the tools like 7zip,360zip split files with no postfix .zip,can you support this as a new feature ? I just happen to meet this situation.

@srikanth-lingala
Copy link
Owner

Yes, I can implement this and it seems to be a good idea to have this feature in zip4j. But I cannot promise a timeline of when I can implement this. There are already some new feature requests in queue. I will leave this issue open and update it once the feature is implemented.

@srikanth-lingala srikanth-lingala added new-feature New feature or request and removed question labels Jan 6, 2020
@srikanth-lingala srikanth-lingala self-assigned this Jan 6, 2020
@YuYin
Copy link
Author

YuYin commented Jan 7, 2020

ok,thanks a lot!

@oleg-cherednik
Copy link

@srikanth-lingala The 7zip is sly as a fox. It does not support the correct zip split; it creates solid zip file first and only then split it into the required size. Therefore

  • CentralDirectoryOffs in EndCentralDirectory section comes from the first disk;
  • The first disk does not have a split archive marker;
  • And I think that it does not know that CentralDirestory+Zip64+EndOfCentralDirectoryShould be in the same disk.

I wonder why did they do that?!

@srikanth-lingala
Copy link
Owner

@oleg-cherednik I wonder as well the reasoning behind 7zip to not follow the zip specification of splitting files. This only makes interoperability between tools quite harder. I guess that 7z format has such split format and they stuck with using the same with zip files as well. However, this leads to the situation where split zip files created by 7zip cannot be read by other tools following zip specification. This is not the only instance where they do not follow zip specification. They have a similar behaviour with utf8 support which is not the default and they use system charset as the default, which is also a bit strange. There were some other instances as well where they took a different approach and not the specification, although I can't seem to remember them now.

However, I will add a way in zip4j that supports reading such split files as well, because, unfortunately 7zip, while even though does not follow specification in some circumstances like this one, is a popular tool and people will end up having such split files, and it will be good to have support for it in zip4j.

@srikanth-lingala
Copy link
Owner

Feature included in v2.4.0 released today

@YuYin
Copy link
Author

YuYin commented Apr 30, 2020

@srikanth-lingala thanks for you!

@srikanthvadde
Copy link

When i use the zipFile.createSplitZipFile(files, zipParameters, true, 1024 * 70) this line actually split the original zip file into multiple based on size i.e. 70kb.But the content inside the all zip files are same.the content is not splitting up. could you please resolve this issue? or is there any other way call the function?

@srikanth-lingala
Copy link
Owner

@srikanthvadde This issue is unrelated to the one this thread is about. Please open a new issue with the problem you are facing, and include as many details as possible like zip4j version, your complete code snippet, os and version, and anything else that you think might be useful. BTW, if you are already not on the latest version of zip4j, try with the latest version before opening this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
new-feature New feature or request resolved
Projects
None yet
Development

No branches or pull requests

4 participants