How to restrict users to upload .pdf and .zip only in Modern SharePoint Online Site (Document Library)
Question
How we can restrict to users to upload only few files types in Document Library (SharePoint Online, Modern Communication Site).
I have two libraries one can accept only .pdf and .zip and another can accept only .pdf.
I am using SharePoint Online Modern Communication site, and Document Library.
Solution
This is not possible in SharePoint Online using OOTB capabilities of SharePoint.
However there are some workaround to achieve this:
- Create an Event receiver to check the file type before uploading it to Document library like given at: Restrict File Types in SharePoint Document Library Upload using Event Receiver.
- Create a Microsoft Flow which will check the file type and if it is not the desired file type you want then you can delete that file from document library (Additionally you can email an user who uploaded it informing you are deleting that file) .
- Creating a SharePoint designer workflow (If you don't have license to create Microsoft flow) which will act similar to Microsoft flow.
Similar Threads:
Licensed under: CC-BY-SA with attribution
Not affiliated with sharepoint.stackexchange