我需要进行 ajax 调用,将文件从 sling 存储库中的一个文件夹移动到另一个文件夹。
我可以通过此 ajax 调用删除文件
$.ajax(
{
url : del_url,
beforeSend: function (xhr) {
xhr.setRequestHeader ("Authorization", make_base_auth());
},
type : "POST",
traditional : "false" ,
data:{
":operation" : "delete",
":applyTo" :files
}
});
我现在需要将文件从“copyFromURL”移动到“moveToURL”。我怎样才能通过ajax调用做到这一点?
最佳答案
我不确定您的具体 Ajax 调用,但有 move support in the Sling Post Servlet 。以下是 HTML 表单的工作方式:
<!-- trailing slash generates a name for the new node -->
<form method="POST" action="/content/page/" enctype="multipart/form-data">
<input type="hidden" name="image@MoveFrom" value="/tmp/upload/123" />
<input type="text" name="title" />
<input type="text" name="text" />
<input type="Submit" />
</form>
关于jquery - Ajax 调用在 sling 中移动文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31906362/