Facing issue while copying folder contains files from one library to another Library using pnp js

Copper Contributor

 

I am trying to copy the folder from one library to another library. But i am getting an error as below.

 

pnpWebsite.getFolderByServerRelativePath(...).copyTo is not a function TypeError: pnpWebsite.getFolderByServerRelativePath(...).copyTo is not a function.

 

I tried like below

var pnpWebsite = $pnp.sp.web; pnpWebsite.getFolderByServerRelativePath("Path").copyTo(LibraryUrl).then(function(res) { });

 

Am i doing any wrong. Please correct me

0 Replies