I am working on a project where I have to build the logic to upload documents into document set folders and I am stuck building the end point.

Can we work with document sets in the same way we do it with document libraries?

Is the following approach ok?

url = webUrl + "/_api/web/lists/getByTitle(@TargetLibrary)/RootFolder/folders(@TargetFolderName)/files/add(url=@TargetFileName,overwrite='true')?" +
           "@TargetLibrary='" + library + "'" +
           "@TargetFolderName='" + folder + "'" +
           "&@TargetFileName='" + file.name + "'";

I would appreciate if you could point me in the right direction, I have been stuck for hours now.

  • Yes you can copy files in to document sets the same way as into folders. Sorry I'm not posting code here.
    – Gil Roitto
    Mar 22, 2016 at 23:25
  • Thanks Asad. I could not make it work using the endpoint above but it worked using the following sintax, in case anyone faces the same challenge: https://<url>/sites/<site>/_api/web/getfolderbyserverrelativeurl('<document set/folder>')/files
    – Paul R
    Mar 24, 2016 at 11:03


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.