cURL command to download cq package | Community
Skip to main content
gk4
New Participant
October 16, 2015
Solved

cURL command to download cq package

  • October 16, 2015
  • 10 replies
  • 5870 views

Hi All,

I want to download package which is created by package manager using cURL command.If anyone come across using this kind of command please share with me.

I have tried below but not succeeded.

curl -k -u "$USER_NAME":"$PASSWORD" -X GET "$URL""$PORT"/etc/packages/my_packages/testpackage123.zip

url -k -u "$USER_NAME":"$PASSWORD" "$URL""$PORT"/etc/packages/my_packages/testpackage123.zip

Thanks In Advance,

Kishore

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.

10 replies

RashidJorvee
New Participant
February 17, 2022

This is working for me to download a content package from AEM.

 

curl.exe -u admin:admin 'http://localhost:4502/wcm_author/crx/packmgr/download.jsp?_charset_=utf-8&path=/etc/packages/my_packages/calculator.zip' -o calculator.zip
smacdonald2008
smacdonald2008Accepted solution
New Participant
October 16, 2015
Feike_Visser1
Employee
October 16, 2015

Here also a very handy article:

https://gist.github.com/sergeimuller/2916697

gk4
gk4Author
New Participant
October 16, 2015

smacdonald2008 wrote...

This is talked about here:

http://www.cqtutorial.com/courses/cq-admin/cq-admin-lessons/cq-maintenance/cq-package-manager

 

Hi,

I have tried as mentioned in the link but still throwing error.

I am accessing my CQ instance, as "https://<hostname>:<port>/wcm_author/projects.html"

curl -k -u "$USER_NAME":"$PASSWORD" "$URL""$PORT"/etc/packages/my_packages/testpackage123.zip

Error:

<html><head><title>JBoss Web/2.1.10 - Error report</title><style><!--H1 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:22px;} H2 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:16px;} H3 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:14px;} BODY {font-family:Tahoma,Arial,sans-serif;color:black;background-color:white;} B {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;} P {font-family:Tahoma,Arial,sans-serif;background:white;color:black;font-size:12px;}A {color : black;}A.name {color : black;}HR {color : #525D76;}--></style> </head><body><h1>HTTP Status 404 - /etc/packages/my_packages/testpackage123.zip</h1><HR size="1" noshade="noshade"><p><b>type</b> Status report</p><p><b>message</b> <u>/etc/packages/my_packages/testpackage123.zip</u></p><p><b>description</b> <u>The requested resource (/etc/packages/my_packages/testpackage123.zip) is not available.</u></p><HR size="1" noshade="noshade"><h3>JBoss Web/2.1.10</h3></body></html>

New Participant
October 16, 2015

Hi Kishore,

To downlaod please try this

 

curl -u admin:'password' 'http://<>hostname>:<port>/crx/packmgr/download.jsp?_charset_=utf-8&path=/etc/packages/my_packages/packagename.zip'  --O  packagename.zip

gk4
gk4Author
New Participant
October 16, 2015

Thanks Gokul.I am seeing below error while executing cURL command.

----------------------------------
 Downloading Content Package
----------------------------------
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0Warning: Failed to create the file testpackage123.zip
  1  489k    1  8801    0     0   118k      0  0:00:04 --:--:--  0:00:04 1432k
curl: (23) Failed writing body (0 != 8801)

curl -k -u admin:<password> 'https://<hostname:port>/wcm_author/crx/packmgr/download.jsp?_charset_=utf-8&path=/etc/packages/my_packages/testpackage123.zip' --O testpackage123.zip

Any idea why i am getting this error?

Thanks,

Kishore

New Participant
October 16, 2015

Hi Kishore,

Please try without .zip .

curl -k -u admin:<password> 'https://<hostname:port>/wcm_author/crx/packmgr/download.jsp?_charset_=utf-8&path=/etc/packages/my_packages/testpackage123.zip' --O XXXX

New Participant
October 16, 2015

And --O (it is in caps)

RashidJorvee
New Participant
February 17, 2022

for me it works on small case on Windows powershell.

gk4
gk4Author
New Participant
October 16, 2015

i have tried that too but no luck.

Is this working for you?

Thanks,

Kishore

gk4
gk4Author
New Participant
October 16, 2015

Finallly ,i have nailed the issue.Below is the final cURL command to download the package.

curl -k -u admin:<password> -X GET -F 'packageName=testpackage123' -F 'path=/etc/packages/my_packages/testpackage123.zip' -F 'groupName=my_packages' -F '_charset_=UTF-8' https://<hostname>:<port>/wcm_author/crx/packmgr/download.jsp --O testpackage123.zip

Thanks everyone for your valuable inputs and time.

Connect Again smiley

Thanks,

Kishore