I'm using SharePointOnline's Modern UI.

I would like to display an error message if a user uploads anything other than a PDF file in the document library.
Is there any way to achieve this other than an event receiver?

I would appreciate any ideas or pointers.

1 Answer 1


For now, there is no OOB approach to block certain file types in a library, Here is a User Voice where you can vote for adding this feature.

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.