I am a fresher and want to use SharePoint 2013 with php. What I really want to do is create folders, sub-folders and write .xlsx files inside these folders and also want to read and download these files using php. can anyone help me? I only understand PHP and java-script.

2 Answers 2


You can create folders and subfolders using the Lists web service using the UpdateListItems method. The following example code takes a foldername argument and creates a folder in the root folder of the list. If you want to create a folder within another folder then just change the RootFolder attribute to the url of the folder. Hope this helped.


public static void UpdateListItemCreateFolder(string folderName)
        listservice.Lists listProxy = new listservice.Lists();

        string xmlconst = "<Batch OnError='Continue' 
RootFolder='http://basesmcdev2/sites/tester1/tester2'><Method ID='1' 
Cmd='New'><Field Name='ID'>New</Field><Field Name='FSObjType'>1</Field>
<Field Name='BaseName'>!@foldername</Field></Method></Batch>";

        listProxy.Url = 
        listProxy.UseDefaultCredentials = true;

        XmlDocument doc = new XmlDocument();
        string xmlFolder = xmlconst.Replace("!@foldername", folderName);
        XmlNode batchNode = doc.SelectSingleNode("//Batch");
        XmlNode resultNode = listProxy.UpdateListItems("tester2", 

Like @Sara says, you can use list web services to create items in a document library. If you want to use only JavaScript, you can use SharePointPlus.js. This library allows you to use list web services via JavaScript.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.