Question

I have a SharePoint intranet site where I need to allow users to upload certain documents. These documents need to be only PDF files for example.

What is the simplest way to restrict the document library to only PDF (just checking the extension PDF is fine) ?

Was it helpful?

Solution

there is no OOB solution for this. But you could create an eventhandler (event receiver) and triggers on item adding, that checks the file name and if it's not the correct file extension just cancel event. /WW

OTHER TIPS

If you prefer not to deploy any of your own custom code to your WFEs then you may want to consider a simple SharePoint Designer workflow as well.

Have a look at this article that describes something similar and can easily be adapted (it renames a file from a workflow when it contains sensitive information in the file name).

Providing feedback to the customer is indeed a problem. An event receiver allows you to provide slightly better feedback than a workflow, but only slightly. SharePoint 2010 allows event receivers to provide better feedback.

I know its not what you ask for, but for completeness i want to add that you can deny files by extension in Central Administration if you are using MOSS.

Manage blocked file types (Office SharePoint Server)

Anders Rask

You can create a workflow in SharePoint designer that moves non PDF files to another library, see http://www.documentmanagementworkflowinfo.com/sample-sharepoint-workflows/sharepoint-designer-workflow-move-document-one-library-next.htm for an example

Just Block all Other Extensions Except pdf. You Can Do this with the help of Sharepoint Central Admin->Security->Define Blocked File Types

Licensed under: CC-BY-SA with attribution
Not affiliated with sharepoint.stackexchange
scroll top