0

I need to create folder under Site Pages library under SharePoint Online site.

I have tried to create the folder programmatically using @pnp/sp library. But it thrown me Access Denied error.

New Folder option is missing while click on New. Please check below screenshot, enter image description here

I have check the solutions for the same and I got the solution if New folder option will enable then I can create new page.

So, I need to enable New Folder option programmatically using @pnp/sp library as per the below screenshot, enter image description here

Can anyone help me with the same?

1 Answer 1

0

You need to allow folder creation. Go to library settings -> advance settings-> Set to yes "Make "New Folder" command available?"

Sign up to request clarification or add additional context in comments.

5 Comments

Thanks for quick response. I need to do that programmatically using @pnp/sp. Do you have any idea to achieve the same using @pnp/sp?
It is one time config per site, so you can do it manualy maybe. I am not sure if you can do it via pnp/sp. For sure you can achive it via pnp powershell by running "Set-PnPList -Identity "Documents" -EnableFolderCreation 1 "
Thanks for reply. But I need to do that programmatically using @pnp/sp
I don`t think it is possible. Check microsoft graph
I have achieve the same using @sp/pnp. Here is the link for the same. pnp.github.io/pnpjs/sp/folders/#add Thank you again.

Your Answer

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