Expand my Community achievements bar.

SOLVED

Manually modifying the package and re-uploading

Avatar

Level 4

Hi all,

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.

zip.PNG

1 Accepted Solution

Avatar

Correct answer by
Level 2

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.

zip-file.jpg

View solution in original post

8 Replies

Avatar

Administrator
@Ravi_Pampana thank you for providing solution to the community.


Kautuk Sahni

Avatar

Level 4

Thanks for sending the link. But the command jar -cvfm <<new-package-name>.zip  META-INF/   jcr_root/ is not working unfortunatelty.

Getting this message

jar -cvfm racha.zip  META-INF/   jcr_root/

java.io.FileNotFoundException: META-INF (Access is denied)

        at java.io.FileInputStream.open0(Native Method)

Avatar

Community Advisor

Hi Vitis

     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 ?

1360228_pastedImage_1.png

If so , Please do the following

1. Right click your zip file and click "Extract here ". (Do not extract to a folder)

1360227_pastedImage_0.png

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" .

1360288_pastedImage_6.png

(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

1360287_pastedImage_5.png

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 .

Avatar

Level 4

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....

Avatar

Correct answer by
Level 2

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.

zip-file.jpg

Avatar

Administrator
@chun-pin thank you for sharing answer with community.


Kautuk Sahni