Manually modifying the package and re-uploading

Avatar

Avatar

vitis90

Avatar

vitis90

vitis90

28-11-2017

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

Accepted Solutions (1)

Accepted Solutions (1)

Avatar

Avatar

chun-pin

Avatar

chun-pin

chun-pin

10-02-2021

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

Answers (4)

Answers (4)

Avatar

Avatar

Ravi_Pampana

MVP

Avatar

Ravi_Pampana

MVP

Ravi_Pampana
MVP

28-11-2017

Avatar

Avatar

bobkranson

Avatar

bobkranson

bobkranson

28-11-2017

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

Avatar

vitis90

Avatar

vitis90

vitis90

28-11-2017

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

Avatar

Veena_Vikram

MVP

Avatar

Veena_Vikram

MVP

Veena_Vikram
MVP

28-11-2017

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 .