I have a requirement where I have to download a dam package, extract it and add more images through windows explorer, re-zip it and upload the package again. However, AEM rejects any package which is compressed manually saying 'missing JCR_ROOT'. Even if i dont change any content, AEM still rejects packages which are zipped manually. Is there any workaround for it? Our use-case is to have the author add more images in the folders, re-zip it and upload again, as this reduces authoring time.
Make sure when you Extract the zip file, the configuration is NOT creating folder for the extracted file. Otherwise, when you compress the file back into a zip file again, the folder structure will be different than the original one.
Use 7-Zip to add to the archive. It has been my experience with other 'jar' archives that Windows or other 'zip' technologies can change the file signatures. 7-Zip has always allowed me to add things without breaking the archive. Please post your result if you use 7-zip.
By the way, if you repackage with 'jar' and use '-cvMf', you must use a capital 'M' to preserve existing META-INF. The small 'm' means something else....
How are you planning to copy the DAM content ? Every DAM asset will have below structure when extracted. Do you have another DAM zip which you are trying to copy to this one ?
If so , Please do the following
1. Right click your zip file and click "Extract here ". (Do not extract to a folder)
2. Once you get these folders , add/modify your content to the corresponding folder
3. Select the jcr_root and META-INF folder and right click and "Add to Zip file" .
(I use WinSCP for this and it works fine). Give the name of the package . If you want to change the name of the package to be uploaded just change the name in the properties.xml file inside META-INF --> Vault
Please make sure that if you are adding DAM assets you do it the right way. The content structure for the DAM assets should be followed properly else you will end up in corrupted packages. I will not recommend to do this way unless for a small fix or tweak .