copyPage curl command

Avatar

Avatar
Validate 1
Level 2
atulj76172708
Level 2

Likes

8 likes

Total Posts

34 posts

Correct reply

6 solutions
Top badges earned
Validate 1
Ignite 3
Ignite 1
Give Back 5
Give Back 3
View profile

Avatar
Validate 1
Level 2
atulj76172708
Level 2

Likes

8 likes

Total Posts

34 posts

Correct reply

6 solutions
Top badges earned
Validate 1
Ignite 3
Ignite 1
Give Back 5
Give Back 3
View profile
atulj76172708
Level 2

11-04-2019

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.

1731044_pastedImage_3.png

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

Accepted Solutions (1)

Accepted Solutions (1)

Avatar

Avatar
Give Back 5
Employee
shunnar
Employee

Likes

12 likes

Total Posts

46 posts

Correct reply

10 solutions
Top badges earned
Give Back 5
Give Back 3
Give Back 10
Give Back
Boost 5
View profile

Avatar
Give Back 5
Employee
shunnar
Employee

Likes

12 likes

Total Posts

46 posts

Correct reply

10 solutions
Top badges earned
Give Back 5
Give Back 3
Give Back 10
Give Back
Boost 5
View profile
shunnar
Employee

11-04-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.

Answers (3)

Answers (3)

Avatar

Avatar
Boost 10
Level 2
jezwn
Level 2

Likes

11 likes

Total Posts

76 posts

Correct reply

2 solutions
Top badges earned
Boost 10
Give Back 5
Contributor
Shape 1
Springboard
View profile

Avatar
Boost 10
Level 2
jezwn
Level 2

Likes

11 likes

Total Posts

76 posts

Correct reply

2 solutions
Top badges earned
Boost 10
Give Back 5
Contributor
Shape 1
Springboard
View profile
jezwn
Level 2

29-06-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

Avatar

Avatar
Validate 1
Level 2
atulj76172708
Level 2

Likes

8 likes

Total Posts

34 posts

Correct reply

6 solutions
Top badges earned
Validate 1
Ignite 3
Ignite 1
Give Back 5
Give Back 3
View profile

Avatar
Validate 1
Level 2
atulj76172708
Level 2

Likes

8 likes

Total Posts

34 posts

Correct reply

6 solutions
Top badges earned
Validate 1
Ignite 3
Ignite 1
Give Back 5
Give Back 3
View profile
atulj76172708
Level 2

11-04-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.

Avatar

Avatar
Validate 1
Level 2
atulj76172708
Level 2

Likes

8 likes

Total Posts

34 posts

Correct reply

6 solutions
Top badges earned
Validate 1
Ignite 3
Ignite 1
Give Back 5
Give Back 3
View profile

Avatar
Validate 1
Level 2
atulj76172708
Level 2

Likes

8 likes

Total Posts

34 posts

Correct reply

6 solutions
Top badges earned
Validate 1
Ignite 3
Ignite 1
Give Back 5
Give Back 3
View profile
atulj76172708
Level 2

11-04-2019

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

I'll try some other alternatives.