Expand my Community achievements bar.

SOLVED

Adobe DAM server extractiong the zip file and activate the assets using curl

Avatar

Level 1

Hi, 

 

I have a requirement to upload the zip file, and extract it in dam server and activate the assets using curl. Currently I'm able to upload the zip file using curl, but I'm unable to extract it with curl, here I'm using bash script to upload the files but seems like most of the community using the java.

Could you guide me, is it possible to extract the zip in DAM server.

 

 

Thanks.

1 Accepted Solution

Avatar

Correct answer by
Employee Advisor

Hi,

If its an AEM package itself, then you can do it two ways.

 

1. Upload, Install and replicate

a. upload & install
curl -u admin:admin -F file=@"name of zip file" -F name="samplepackage.zip" -F force=true -F install=true http://localhost:4502/crx/packmgr/service.jsp

b. replicate

curl -u admin:admin -X POST  http://localhost:4502/crx/packmgr/service/.json/etc/packages/my_packages/samplepackage.zip?cmd=repli...

 

2. Upload, Install in author and publisher instances separately

Use curl of 1.a itself 

 

If your requirement is just to have assets and not as an AEM package, you need to do it asset by asset.

1. Upload an Asset(Ex: test.png)
curl -u admin:admin -X POST -F file=@"test.png" http://localhost:4502/content/dam/geometrixx/portraits.createasset.html

2. Activate the asset

curl -u admin:admin -X POST -F path="/content/dam/geometrixx/portraits/test.png" -F cmd="activate" http://localhost:4502/bin/replicate.json

 

View solution in original post

2 Replies

Avatar

Correct answer by
Employee Advisor

Hi,

If its an AEM package itself, then you can do it two ways.

 

1. Upload, Install and replicate

a. upload & install
curl -u admin:admin -F file=@"name of zip file" -F name="samplepackage.zip" -F force=true -F install=true http://localhost:4502/crx/packmgr/service.jsp

b. replicate

curl -u admin:admin -X POST  http://localhost:4502/crx/packmgr/service/.json/etc/packages/my_packages/samplepackage.zip?cmd=repli...

 

2. Upload, Install in author and publisher instances separately

Use curl of 1.a itself 

 

If your requirement is just to have assets and not as an AEM package, you need to do it asset by asset.

1. Upload an Asset(Ex: test.png)
curl -u admin:admin -X POST -F file=@"test.png" http://localhost:4502/content/dam/geometrixx/portraits.createasset.html

2. Activate the asset

curl -u admin:admin -X POST -F path="/content/dam/geometrixx/portraits/test.png" -F cmd="activate" http://localhost:4502/bin/replicate.json

 

Avatar

Employee Advisor

You can look into creating the CURL command when you try to extract a sample file from the assets UI. Check [1] for more details. 

 

[1] https://helpx.adobe.com/experience-manager/6-3/sites/administering/using/curl.html#BuildingacURLRead...