restrict to download documents for particular times
I have a document library, i want users can view the documents and be able to download to particular no of times, such as each user can download only 10 times any document after that they can only view should not be able to download.
Is it possible in sharepoint?Regards urvinit
February 18th, 2011 12:40am
I think it's not possible using OOB solutions. You have to write custom code.
For example - handle each download event, increase the downloads count for the specified user (you have to store this info somewhere, for example in another custom list) and after reaching to the limit - just change user permissions on the list.
_____________________________
Zorayr Zakaryan Lightning Tools
Free Windows Admin Tool Kit Click here and download it now
February 18th, 2011 3:22am
Hi urvinit,
You may consider to create a workflow to do this. This method is same with Zorayr said above in theory. Create a list to restore the download counts
of users. Each time after the user download is complete, add 1 to the download count of the user, then compare the download count with limit count, if download count is larger than limit count, change the download permission of the user.
Thanks & Regards,
Peng Lei
February 21st, 2011 3:24am
Hi Peng and Zorayr, Thanks for replying... Is there any SPListItemEventReciever to check downloads(like ItemAdded) on which event i can count no of downloads.how i will know that the item is being downloaded. Can u give me any reference of something like
this through which i can get help.Regards urvinit
Free Windows Admin Tool Kit Click here and download it now
February 22nd, 2011 12:54am
Hi
As I know, there is no smart way to handle download event, and instead of you have to customize your interface (to handle download clicks) or maybe use custom HttpHandler to handle each request.
_____________________________
Zorayr Zakaryan Lightning Tools
February 22nd, 2011 4:31am
There is no way to track the downloads through event handlers, you need to intercept the request in Http pipeline.You need to develop a httphandler to track the downloads. Track all requests through this handler and put a keyvalue pair in session/database
for each user per request. Validate the stored keyvalue pair before kick starting the actual download. Refer this artice:-http://www.devx.com/codemag/Article/34535Aravind http://aravindrises.blogspot.com
Free Windows Admin Tool Kit Click here and download it now
February 22nd, 2011 12:41pm
There is no way to track the downloads through event handlers, you need to intercept the request in Http pipeline.You need to develop a httphandler to track the downloads. Track all requests through this handler and put a keyvalue pair in session/database
for each user per request. Validate the stored keyvalue pair before kick starting the actual download. Refer this artice:-http://www.devx.com/codemag/Article/34535Aravind http://aravindrises.blogspot.com
February 22nd, 2011 12:41pm
Hi,
how i will attach the httphandler to a particular document library.Regards urvinit
Free Windows Admin Tool Kit Click here and download it now
February 23rd, 2011 2:39am
Hi
You can process the http context during the execution and check whether it related to your list or not.
Here is one
tutorial how to create httphandler for SP
And here is an
example how to get current list from httphandler.
____________________________
Zorayr Zakaryan Lightning Tools
February 23rd, 2011 2:49am