I have created functionality for folder creation under the SharePoint document library nested folder and copied files from another folder to a recently created folder.
I have used the "@pnp/sp":"2.11.0" library for performing the folder creation and copy folder operations.
It is working as expected for one user but it throws an error for the second user. I have added both users to the Site Owners group.
Below is the error screenshot while the second user performing the action.
Below is my code snippet for the same,
import { sp } from "@pnp/sp";
import "@pnp/sp/webs";
import "@pnp/sp/lists";
import "@pnp/sp/items";
import "@pnp/sp/files";
import "@pnp/sp/folders";
export const copyFilesInDocLibFolder = async (
const copyFiles = await sp.web.getFolderByServerRelativePath(sourcePathUrl).copyByPath(destinationPathUrl, false);
return copyFiles;
}
Can anyone help me with the same?
Thanks