Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

I have a requirement for a group of users in a SharePoint site to be allowed to upload documents larger than the default 50MB - i.e. 100MB. All other users must keep this 50MB limit however.

During the document upload event, is it possible to override the farm level if the current user is in a specified group or has a specified custom permission? Otherwise could I set the farm level upload limit to 100MB and then prevent uploads from users with a 50MB limit during the document upload event?

share|improve this question
add comment

1 Answer

up vote 1 down vote accepted

Your main problem as I can see it is that the limits for document upload are set in various places. The lowest level at which you can set this limit is across a web application as it is defined in the web.config file. There are other areas above that scope such as the IIS metabase and machine.config files, but Web Application is the lowest scope AFAIK.

Even if you set this though it can not be over ridden on a user by user basis.

The only way I can think would be to write an event receiver which checks the file size of the document and the user attempting the upload and compares this with a seperate list containing users and a value for the file size which they can upload. Assuming the user has a value in this list greater or equal to the file size they are attempting then this would be allowed otherwise the event is cancelled.

There is some information on creating an event receiver here - great author ;-) http://www.simple-talk.com/dotnet/.net-framework/how-to-create-event-receivers-for-windows-sharepoint-services-3.0/

You would need to set your Web Application settings to the largest allowable file size and bear in mind that even if you set your list value higher than this for a given user IIS will reject the request.

share|improve this answer
    
Is that a complete list of event receivers? Whilst doing this check as part of a list itemadding event would work, the practicality of adding this event receiver to all existing and all new lists would make it a pain. Is there no site or web scoped event I could hook into that is fired when a user uploads a document? –  Jonny May 13 '10 at 16:28
    
Your event receiver is added only to lists which use a specific list template. E.g. the document library. –  Charles Lee May 13 '10 at 19:07
    
<Receivers ListTemplateId="101"> would be in yuor element manifest. Look at the article again. –  Charles Lee May 13 '10 at 19:09
    
Great thanks for the detail! –  Jonny May 14 '10 at 8:39
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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