copyPage curl command | Community
Skip to main content
Level 3
April 11, 2019
Solved

copyPage curl command

  • April 11, 2019
  • 4 replies
  • 3347 views

Hello Team,

I am trying to run a curl command for copying a document from on location in DAM to another location on AEM server.

$ curl -u admin:admin -F cmd=copyPage -F destParentPath=/content/dam/we-retail/en/activities/climbing -F srcPath=/content/dam/we-retail/en/activities/biking/cycling_2.jpg http://localhost:4502/bin/wcmcommand

However it tries to copy a location from my local disk. I am trying to run a curl to make a copy happen within two location in AEM server.

Below is the error screen shot.

Another alternative for me is to try fiddle script or package way.

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

Seems like you're using Windows, try it with cygwin curl or Linux/Mac curl. Seems like the curl command is not sending the proper request to AEM.

4 replies

sssfaffaaaAdobe EmployeeAccepted solution
Adobe Employee
April 11, 2019

Seems like you're using Windows, try it with cygwin curl or Linux/Mac curl. Seems like the curl command is not sending the proper request to AEM.

AlthamAuthor
Level 3
April 11, 2019

I am on the windows machine, but trying to run it in git bash.

I'll try some other alternatives.

AlthamAuthor
Level 3
April 11, 2019

I tried my command on a remote linux server. And it works.

Looks like git bash is not able to run the command successfully.

Thank you.

jezwn
Level 5
June 29, 2021

You can use the following js instead, in the browser console.

 

$.ajax({ type: "POST", url: "/bin/wcmcommand?srcPath=/path/to/source&destParentPath=/path/to/destination&cmd=copyPage"});

 

Hope this helps