SPServices Add New Folder in library and also subfolders.
For New Folder:
var librarynaem = "";
var newfolder = "foldername";
function CreateFolder() {
jQuery().SPServices({
operation: "UpdateListItems",
async: false,
listName: librarynaem ,
updates: "<Batch OnError='Continue' PreCalc='TRUE' ListVersion='0' >" +
"<Method ID='1' Cmd='New'>" +
"<Field Name='FSObjType'>1</Field>" +
"<Field Name='BaseName'>" + newfolder + "</Field>" +
"</Method>" +
"</Batch>",
completefunc: function(xData, Status) {
//alert("Status=" + Status);
}
});
}
To dd sub folders pass the folder location:
as newfolder ="folder1/folder2/yourfoldername";
No comments:
Post a Comment