I wish to copy documents of one library to another. Here I am using SharePoint App in which I am providing drop-down lists to select documents and then clicking on button I am inserting those drop-down list values into one list.

Here I am inserting data into list because, I want to create a new folder in the destination library.

I have two libraries

This Source library will contain many documents those will be listed into App into the various drop-downs and after that, I wish to copy those selected documents into a destination library.
like bellow snaps
enter image description here

enter image description here

NOTE- I'm using SharePoint designer workflow 2010

1 Answer 1


This can be done multiple ways.

Via Server object model.

SPFile sourceFile = web.GetFile("http://basesmcdev2/sites/tester1/tester2/A0805051340558063824.txt");

sourceFile.CopyTo("http://basesmcdev2/sites/tester1/sub1/shared documents/A000345.txt", true);

Via Jquery/SpServices.

function copyItem(){
        var itemurl = "<yoursourcrul>"; //CHANGE THIS
        var dst = "<yourdetsinationurl>"; // CHANGETHIS
            operation: "GetItem",
            Url: itemurl,
            async: false,
            completefunc: function (xData, Status) {
                itemstream = $(xData.responseXML).find("Stream").text();
                itemfields = "";

            operation: "CopyIntoItems",
            SourceUrl: itemurl,
            async: false,
            DestinationUrls: [dst],
            Stream: itemstream,
            completefunc: function (xData, Status) {
                var error = $(xData.responseXML).find("CopyResult").first().attr("ErrorCode");
  • so i can put this code in my App's files here inside app.js,rigth?
    – Madhav
    Nov 24, 2016 at 9:28
  • yes....and call this method, you can modify method to take sourceurl and destinationurl as parameters... and call this method on button click. Nov 24, 2016 at 10:40

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.