내 커뮤니티 업적 표시줄을 확대합니다.

Submissions are now open for the 2026 Adobe Experience Maker Awards.

Mark Solution

활동이 없어 이 대화는 잠겼습니다. 새 게시물을 작성해 주세요.

해결됨

Create Version of Existing Asset : CURL Script

Avatar

이전 커뮤니티 멤버

Hi,

I have a shell script running on AEM server which uploads assets from a shared drive to AEM (6.0 SP2) over regular interval. I am using curl script to ingest this file to AEM although what i am noticing that previous version information of asset is getting lost.

curl -s -u admin:admin -F "jcr:primaryType=dam:Asset" "$aemServer""$aemAssetPath"

curl -s -u admin:admin -F "jcr:primaryType=dam:AssetContent" "$aemServer""$aemAssetPath"/jcr:content

curl -s -u admin:admin -F "jcr:primaryType=nt:folder" "$aemServer""$aemAssetPath"/jcr:content/renditions

curl -s -u admin:admin -F "jcr:primaryType=nt:unstructured" -F "jcr:mixinTypes=cq:Taggable" "$aemServer""$aemAssetPath"/jcr:content/metadata

curl -s -u admin:admin --form original="@$assetName" --form "$assetName@TypeHint"=nt:file "$aemServer""$aemAssetPath"/jcr:content/renditions

Please help. Is there a way i can ingest an asset using script and can also maintain version information (like when we upload existing asset from UI)

Thanks ! 

1 채택된 해결책 개

Avatar

정확한 답변 작성자:
Level 10

If you want to automate getting assets into the AEM dam - do not use CURL. Instead - use the AssetManager API:

https://docs.adobe.com/docs/en/cq/5-6-1/javadoc/com/day/cq/dam/api/AssetManager.html

Using the AssetManager API is best practice for getting assets into AEM using code. 

You can define a https://docs.adobe.com/docs/en/cq/5-6-1/javadoc/com/day/cq/dam/api/Revision.html as well. 

You can use AssetManager within an AEM Sling Servlet - see :

https://helpx.adobe.com/experience-manager/using/multiple-digital-assets.html

원본 게시물의 솔루션 보기

1 답변 개

Avatar

정확한 답변 작성자:
Level 10

If you want to automate getting assets into the AEM dam - do not use CURL. Instead - use the AssetManager API:

https://docs.adobe.com/docs/en/cq/5-6-1/javadoc/com/day/cq/dam/api/AssetManager.html

Using the AssetManager API is best practice for getting assets into AEM using code. 

You can define a https://docs.adobe.com/docs/en/cq/5-6-1/javadoc/com/day/cq/dam/api/Revision.html as well. 

You can use AssetManager within an AEM Sling Servlet - see :

https://helpx.adobe.com/experience-manager/using/multiple-digital-assets.html