Page 1 of 1
Need to create a "ZIP" file without a folder directory.
Posted: Fri Aug 12, 2016 3:31 pm
by arothenberger
I need to Archive (ZIP) a series of files so that when they get unzipped, it's just loose files and not files in a folder.
Any ideas?
Thanks,
Adam
Re: Need to create a "ZIP" file without a folder directory.
Posted: Fri Aug 12, 2016 3:39 pm
by gabrielp
Re: Need to create a "ZIP" file without a folder directory.
Posted: Tue Aug 16, 2016 4:39 pm
by freddyp
And for those without the scripting module, use "Execute command" with the following settings (for OSX, for Windows only the Command is different):
Command: /usr/bin/zip
Arguments: -rj "%2" "%1" -x "*.DS_Store"
Output: File at path
Output extension: ZIP
This will still fail if in the directory structure there are duplicate file names. You can solve this by using "Rename job" in front of the zipping. "Rename job"?? Yes, a not so well-known feature of "Rename job" is that it has an option to "Flatten hierarchy (discarding folders)" and that option has a sub option to resolve file name collisions. So the result of this will be a job folder of just 1 level deep with all files in it. Running the above zip on the "renamed/flattened" job will always work.