0
votes

I have a problem with Upload a package AND install curl command, it doesn't work for me. Is this not available in AEM 6.1?

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

When I first upload package with curl -u admin:admin -F package=@"name_of_package.zip" http://localhost:4502/crx/packmgr/service/.json/?cmd=upload

And the Install it with curl -u admin:admin -X POST http://localhost:4505/crx/packmgr/service/.json/etc/packages/export/name of package?cmd=install

Then it works fine.

Here is response what I get for upload and install

<crx version="1.2.11" user="admin" workspace="crx.default">
   <request>
      <param name="package" value="common-tools-package-1.0.6.zip"/>
      <param name="name" value="common-tools-package"/>
      <param name="force" value="true"/>
      <param name="install" value="true"/>
   </request>
   <response>
      <data>       +------------+-----------------------------------------+        |  Arguments | Comment                                 |        +------------+-----------------------------------------+        |  cmd=help  | print this help                         |        +------------+-----------------------------------------+        |  cmd=ls    | print a list of all packages            |        +------------+-----------------------------------------+        |  cmd=rm    | remove a  package                       |        |  name      | package name                            |        |  [group]   | group name (optional)                   |        +------------+-----------------------------------------+        |  cmd=build | build a  package                        |        |  name      | package name                            |        |  [group]   | group name (optional)                   |        +------------+-----------------------------------------+        |  cmd=inst  | install a package                       |        |  name      | package name                            |        |  [strict]  | true to fail on error                   |        |  [group]   | group name (optional)                   |        +------------+-----------------------------------------+        |  cmd=uninst| uninstall a package                     |        |  name      | package name                            |        |  [group]   | group name (optional)                   |        +------------+-----------------------------------------+        |  GET       | download a package                      |        |            | (content-disposition header contains    |        |            | the correct filename)                   |        |  [cmd=get] | optional                                |        |  name      | package name                            |        |  [group]   | group name (optional)                   |        +------------+-----------------------------------------+        |  POST      | upload a new package                    |        |  file      | package to upload                       |        |  [name]    | optional name                           |        |  [strict]  | true to fail on install error           |        |  [install] | automatically install package if 'true' |        +------------+-----------------------------------------+      </data>
      <status code="200">ok</status>
   </response>
</crx>
1
Problem was in package parameter, value wasn't inside quotes "" - mkovacek

1 Answers

3
votes

Try the below command with progress bar and run it from the directory of the package.

curl -u username:password -F file=@"./YourPackage.zip" -F name=“Package” -F force=true -F install=true http://localhost:4502/crx/packmgr/service.jsp --progress-bar -o upload.txt