-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
D
attribute missing from folder when a file in a subfolder is added
#154
D
attribute missing from folder when a file in a subfolder is added
#154
Comments
|
Maybe I used bad example. We're zipping up all of the folders in a directory and the files they contain using gulp-zip. The only method it uses right now is .file. When we open the zips using 7zip, we see the folders, only without the attribute. We can then navigate into those folders and see the files (and additional subfolders) and again, those subfolders are navigable yet still without the D attribute. Unfortunately, when the application we're deploying the zips to (which is a java-based android app) reads the zips, it apparently looks for anything with a D attribute as a starting place from which to navigate (or at least, that's our best guess at the moment, since the only difference between a working and non-working file is the presence or lack of that attribute, and the "method" property being set to "store" in the working one). Since it doesn't find any, it just returns immediately. We can unzip the files created with gulp-zip and immediately re-zip them with 7zip, winrar, etc, re-deploy, and then they work. So, I think the answer to your question is yes, but the android app that consumes the zip doesn't really see them as folders per se.
|
Okay, so I found 5c91113 and modified the latest version to reverse the changes made in that commit (except for the |
The pull request basically just restores previous code, but with an added check for a |
Note that a bunch of the dev dependencies don't install properly on my (windows) machine, so I was unable to run the grunt build task - that still needs to be done before publishing the new version to npm. |
Gah, there's only one test still failing, and that's the "Delete nested folders from relative path" test. This wouldn't be so bad if only I could actually install all of the stuff I need to test locally, but I can't, so I have to continue checking stuff in, waiting for your Travis instance to build and test it, and then iterate from there. |
I'll take a look (and give you some feedback), that should be less painful ! |
Thanks, that's greatly appreciated. |
Just wondering, but do you have any estimate on when an updated npm package might get published? |
We could do a release today. What do you think about this comment? https://github.com/Stuk/jszip/pull/157/files#r15308300 We could change the API name now, but not after we've had a release. |
I think that makes sense. Do you want to handle it, or should I? |
Would you mind updating it and doing a PR? |
Sure thing, doing it now |
Done, see #160 |
In a case like this:
When the created zip is opened in 7zip or another zip program that shows the attributes of each entry in the zip file, the
subdir
folder exists, but theD
(directory) attribute is not present. This causes problems for decompression libraries that use that attribute to check for the presence of directories within the zip. The.folder
method seems to create the attribute, however.In addition, the
Method
listed for folders should generally bestore
(vsdeflate
for files), but is empty when executing the above example.The text was updated successfully, but these errors were encountered: