Create a nt:file using Curl

It is easy to create a nt:file using Curl

echo ‘hello text’ | curl -u admin:admin -T – http://localhost:4502/content/geometrixx/test.txt

Copy the file from eclipse or the workspace across to the JCR/AEM directly.

The other alternate way of doing this when you have a file in the file system and you want to copy the file across is by using the command below:

curl -i -X POST -H “Content-Type: multipart/form-data” -u admin:admin -F name=abc -F “filename.jsp=@rd.jsp” http://localhost:4502/apps/demo

The above command will create the file filename.jsp within the folder /apps/demo and will copy the file contents of rd.jsp into that file.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s