내 커뮤니티 업적 표시줄을 확대합니다.

Mark Solution

활동이 없어 이 대화는 잠겼습니다. 새 게시물을 작성해 주세요.

해결됨

How do i create a nt:file using Curl?

Avatar

이전 커뮤니티 멤버

Hi,

I have gone through couple of blog post on how i can create nodes and sling:folders, everything works fine. However, i am not able to adapt those to nt:file. I want to create a nt:file and then once that is created, i want to paste some text into that file using curl. I always get 500 exception of Constraint Violation exception.

We want to setup new environments and i want this task to be automated.

Thanks for help in advance.

1 채택된 해결책 개

Avatar

정확한 답변 작성자:
Employee

If you want to create an empty file, you can do something like this:

echo '' | curl -u admin:admin -T - http://localhost:4502/content/geometrixx/test.txt

That said, I don't understand why you want to do this in two steps (create an empty file, then set the file's content). If you have the file content, just create the file using that content in one step.

원본 게시물의 솔루션 보기

2 답변 개

Avatar

정확한 답변 작성자:
Employee

If you want to create an empty file, you can do something like this:

echo '' | curl -u admin:admin -T - http://localhost:4502/content/geometrixx/test.txt

That said, I don't understand why you want to do this in two steps (create an empty file, then set the file's content). If you have the file content, just create the file using that content in one step.

Avatar

이전 커뮤니티 멤버

justin_at_adobe wrote...

If you want to create an empty file, you can do something like this:

echo '' | curl -u admin:admin -T - http://localhost:4502/content/geometrixx/test.txt

That said, I don't understand why you want to do this in two steps (create an empty file, then set the file's content). If you have the file content, just create the file using that content in one step.

 

 

Thanks Justin,

I would be adding the text in one go. I was not sure of which script to use to do that.