How to restrict document download in SharePoint 2010
Is it possible to restrict file downlaods from SharePoint document library.
Manish
Hi Manish,
Information Rights Management is the only way to protect the documents and don't allow user save document in his/her system. You need to setup IRM on your network and the enable it in Central Administration.
Check this MSDN article for more information:
http://office.microsoft.com/en-us/sharepoint-server-help/apply-information-rights-management-to-a-list-or-library-HA101790603.aspx
Hope it could help
Cheers, Hemendra-MCTS "Yesterday is just a memory,Tomorrow we may never see"
Similar Messages
-
Using a PDF as a Document Template in SharePoint 2010: "New Document" icon and action
Hi,
I have to create a document template in SharePoint 2010 using a PDF. After much searching I have learned to install Reader on the SharePoint server to bring in AcroPDF.dll
and set the OpenControl for PDFs in DOCICON.xml to be "AdobeAcrobat.OpenDocuments".
After taking these steps I can check PDFs in and out of SharePoint, and edit PDFs as I would edit an MS Office document.
However two problems remain with creating new documents based upon a PDF document template.
1) The PDF icon does not appear in the New Document dropdown. This makes sense since I never referenced a 32x32 icon in the SharePoint config files. Where would I place the icon image file and which configuration file would I edit to use that image file, and how?
The last three document templates are PDFs.
The second problem I face is that when I click one of the document templates above that is a PDF, nothing happens. I have tried this with Acrobat installed on both the client and the server. It would be preferable to insert a copy of the PDF document used as a template without having to use Acrobat at all.
Is there any resolution to either of these problems?According to what i found the image needs to be 16x16.
See if this works.
Edit the DOCICON.XML file to include the PDF icon
In Windows Explorer, navigate to C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\TEMPLATE\XML
Edit the DOCICON.XML file (I open it in NotePad, you can also use the built-in XML Editor)
Ignore the section <ByProgID> and scroll down to the <ByExtension> section of the file
Within the <ByExtension> section, insert a <Mapping Key=”pdf” Value=”pdficon_small.gif” /> attribute. The easiest way is to copy an existing one – I usually just copy the line that starts <Mapping Key=”png”… and replace the parameters for Key and Value (see image below for example).
Note: Do not take shortcuts and copy/paste from here. 99% of problems with PDF icons not being displayed are due to errors made in the DOCICON.XML file
Save and close the file
Source:
http://www.sharepointsharon.com/2010/03/sharepoint-2010-and-adobe-pdf/ -
How to Copy list item attachment to document library in SharePoint 2010
Hi,
How to Create a folder ("List Item - Title Name") in Document library and copy list items Attachments to the same folder in SharePoint 2010,thanks in advance.
Regards,
Selvan.J
Selvan JHi,
You should first check whether the folder exists in the library, if the folder not exists, then create it.
I had modified the code, you can use the following code snippet to achieve it.
private void EventCopyFileWhenItemCreatedOrUpdated(SPItemEventProperties properties)
SPSite site = new SPSite(http://YourSiteName);
SPWeb web = site.OpenWeb();
SPList doclibList=properties.Web.Lists["YourLibName"];
bool foundFolder = false;
if (doclibList.Folders.Count>0)
foreach (SPListItem fitem in doclibList.Folders)
if (fitem.Title.Equals("FolderA"))
foundFolder = true;
break;
if (foundFolder == false)
SPListItem folder = doclibList.Folders.Add(doclibList.RootFolder.ServerRelativeUrl, SPFileSystemObjectType.Folder,"FolderA");
folder.Update();
string fUrl = doclibList.RootFolder.ServerRelativeUrl+"/FolderA";
SPFolder myLibrary = web.GetFolder(fUrl);
if (properties.ListTitle == "YourListName")
SPListItem sourceItem = properties.ListItem;
properties.Web.AllowUnsafeUpdates = true;
//get the folder with the attachments for the source item
SPFolder sourceItemAttachmentsFolder =
sourceItem.Web.Folders["Lists"].SubFolders[sourceItem.ParentList.Title].SubFolders["Attachments"].SubFolders[sourceItem.ID.ToString()];
//Loop over the attachments, and add them to the target item
foreach (SPFile file in sourceItemAttachmentsFolder.Files)
if (CheckFileNameExist(file.Name , properties) == false)
byte[] binFile = file.OpenBinary();
myLibrary.Files.Add(System.IO.Path.GetFileName(file.Url) , binFile);
private bool CheckFileNameExist(string fileNameInFileAttach, SPItemEventProperties properties)
bool flag = false;
SPList myDocumentLib = properties.Web.Lists["YourLibName"];
SPQuery spQuery = new SPQuery();
SPListItemCollection items = myDocumentLib.GetItems(spQuery);
foreach (SPListItem item in items)
if (fileNameInFileAttach == item["Name"].ToString())
flag = true;
break;
return flag;
Thanks & Regards,
Jason
Jason Guo
TechNet Community Support -
Getting correlation error while opening document library in SharePoint 2010
Hi,
I installed SQL Server 2008 R2 SP1 and SharePoint 2010 on Windows Server 2008 R2. Everything went fine for first days. Now I am getting error while opening any of the document libraries. However lists are opening fine.
Error:
An unexpected error has occured.
Troubleshoot issues with Microsoft SharePoint Foundation
Correlation ID: fa54267f-4436-8298-c7698977728c
I checked the logs, I showing some error with the line http://Microsoft.Office.Server.UserProfiles/GetProfileProperties
Please let me know if you have any idea about this error or let me know if you need further inputs from me. Thanks.Hi Tarique,
Whether you have granted the user proper permissions on this site. You should make sure the user has permissions on the site.
In addition, there are some reasons for the log-in issue, please take a look at:
http://sharepointsolutions.blogspot.com/2008/06/how-do-i-make-our-sharepoint-site-stop.html
http://sharepointsolutions.blogspot.com/2008/06/how-do-i-make-our-sharepoint-site-stop_17.html
http://dinesql.blogspot.com/2011/01/cannot-login-to-sharepoint-2010-site.html
I hope this helps.
Thanks,
Wendy
Wendy Li
TechNet Community Support -
I wrote a macro in a Word 2010 template with a custom property called HeaderFooter (a Yes/No value). When the property is changed to No, the header and footer are hidden, otherwise, the header and footer are displayed.
I added the template to a SharePoint 2010 Document library, with a content type DocInformation and a column name HeaderFooterOffOn that I want to map to the custom property HeaderFooter in the Word Document.
The macro isn't working in SharePoint, though, because when the user clicks on the HeaderFooterOffOn in the DIP of the Word Document, the Word Custom Property (HeaderFooter) isn't changing with it.
How do I get these two synced up, so that when the SharePoint column is changed, the Word Document's custom property simultaneously updates with it?Hi kevinkevinc,
There is no direct way to run macro in SharePoint
As a workaround, I suggest you use SharePoint Event Receiver to run some custom code when column changed.
Here is a similiar thread for your reference:
http://social.msdn.microsoft.com/Forums/office/en-US/249249e2-3263-4001-86fa-bda342d95f35/run-word-macro-on-newly-uploaded-sharepoint-word-documents?forum=sharepointdevelopmentlegacy
More information:
SharePoint Event Receiver:
http://msdn.microsoft.com/en-us/library/ee231563.aspx
http://msdn.microsoft.com/en-us/library/ff398052.aspx
Best Regards
Forum Support
Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Subscriber Support, contact
[email protected]
Zhengyu Guo
TechNet Community Support -
Create folder in Document Library using Sharepoint 2010 Client Object Model
I would like to check for the existence of a folder in s Sharepoint 2010 Document Library and if the folder is not found, create it. (I would then subsequently programmatically upload documents to that folder -- which I have figured out). Can someone
please help me figure out how to check for the extistence of and then create a folder using the Sharepoint 2010 Client Object Model?You can use this:
public static void CreateFolder_ClientOM(string listName, string folderName)
ClientContext clientContext = new ClientContext("http://basesmc2008");
Web web = clientContext.Web;
List list = clientContext.Web.Lists.GetByTitle(listName);
clientContext.Load(clientContext.Site);
string targetFolderUrl = listName + "/" + folderName;
Folder folder = web.GetFolderByServerRelativeUrl(targetFolderUrl);
clientContext.Load(folder);
bool exists = false;
try
clientContext.ExecuteQuery();
exists = true;
catch (Exception ex)
if (!exists)
ContentTypeCollection listContentTypes = list.ContentTypes;
clientContext.Load(listContentTypes, types => types.Include
(type => type.Id, type => type.Name,
type => type.Parent));
var result = clientContext.LoadQuery(listContentTypes.Where
(c => c.Name == "Folder"));
clientContext.ExecuteQuery();
ContentType folderContentType = result.FirstOrDefault();
ListItemCreationInformation newItemInfo = new ListItemCreationInformation();
newItemInfo.UnderlyingObjectType = FileSystemObjectType.Folder;
newItemInfo.LeafName = folderName;
ListItem newListItem = list.AddItem(newItemInfo);
newListItem["ContentTypeId"] = folderContentType.Id.ToString();
newListItem["Title"] = folderName;
newListItem.Update();
clientContext.Load(list);
clientContext.ExecuteQuery();
Blog | SharePoint Field Notes Dev Tool |
ClassMaster -
How to block specific DL in SharePoint 2010 application.
Hi All,
We have SharePoint 2010 farm. I have a requirement to block specific Distribution List which should not recognized when user trying to give access at (user.aspx page)site level.
How can i restrict this in SharePoint 2010 farm.
Regards
S. ManiYou can use content editor webpart to run javascript. Java script will redirect users from accessing the site. You need t o specify the user Id; it wont work on DL
Blow is the java script:
==================Script Start ===============
ExecuteOrDelayUntilScriptLoaded(getWebUserData, "sp.js");
var context = null;
var web = null;
var currentUser = null;
function getWebUserData() {
context = new SP.ClientContext.get_current();
web = context.get_web();
currentUser = web.get_currentUser();
currentUser.retrieve();
context.load(web);
context.executeQueryAsync(Function.createDelegate(this, this.onSuccessMethod), Function.createDelegate(this, this.onFailureMethod));
function onSuccessMethod(sender, args) {
var userObject = web.get_currentUser();
if (userObject.get_loginName() == 'i:0#.w|domain\userid')
window.location="/businesses/pulpandfibre";
function onFailureMethod(sender, args) {
alert('request failed ' + args.get_message() + '\n' + args.get_stackTrace());
=============Script End=============== -
Unable to create a new folder in document library of SharePoint 2010
Hi There,
Need some help regarding an issue which is occurring after migration from SP 2007 to 2010.
We have recently migrated a site to SP 2010, after migration whenever i tried to create a new folder in a document library it gives me an error message below
SPException: Can not find the form to create default data for the list
Microsoft.SharePoint.Utilities.SPUtility.ThrowSPExceptionWithTraceTag (UInt32 TagId, ULSCat traceCategory, resourceId String, Object [] resourceArgs) 28098007
Microsoft.SharePoint.ApplicationPages.ListFormRedirect.InitializeQueryStringMembers () 1764
Microsoft.SharePoint.ApplicationPages.ListFormRedirect.OnLoad (EventArgs e) +25
System.Web.UI.Control.LoadRecursive () 66
System.Web.UI.Page.ProcessRequestMain (Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) 2428
All the document libraries which are created with the custom list template has this problem.
Moreover, I have verified and found Upload.aspx page is available in Forms folder of a document library.
Can someone help me in resolving this issue.
Thank you in advance.
Vikram
vikram padigalaHi,
All the document libraries which are created with the custom list template has this problem.
Did you mean you had a custom library template?
Did the issue occur in the library which created use the out of the box template, such as use the Document Library template?
You can check with the OOB template library to test whether they had the same issue.
If the OOB template library works well, the issue may be related to the custom library template.
You can try to recreate a new custom template to check whether it works.
To quickly and accurately find the issue , you can also check the event log and ULS log to see if anything unexpected occurred.
For SharePoint 2010, by default, ULS log is at
C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\LOGS
Thanks & Regards,
Jason
Jason Guo
TechNet Community Support -
How to restrict document types in hierachy
Hi
My scenario is
For DIR of document type A only DIRs of document type B and C should be attached in the document hierarchy. How to restrict the user from attaching other type of documents?
What will be the best solution for this scenario?
Thanks in advance
Prasad KHi
Plz
Any inputs on this?
Regards
Prasad -
How to design SSRS report using SharePoint 2010 List Version History
Hello,
I am using Sharepoint 2010 list, i need to design SSRS report using Sharepoint List Version History. Could please let me know how to design.
Thank you.
Kind RegardsYou could do that with SQL Server Reporting Services, Please follow the instructions from the link below:
http://www.mssqltips.com/sqlservertip/2068/using-a-sharepoint-list-as-a-data-source-in-sql-server-reporting-services-2008-r2/
Hope that would work fro you.
Please Mark as Answer, if the post works for you.
Cheers,
Amar Deep Singh -
How to make sub sites in SharePoint 2010 as Read Only
Hello,
We have a requirement to make sub site as read only in SharePoint 2010 programmatically.
How we can achieve it using Server Object Model ?
Thanks,
HatimHi,
You can write a WinForm program, and use
SPSecurableObject.BreakRoleInheritance method to achieve your requirement.
More information for your reference:
http://fangdahai.blogspot.com/2012/09/how-to-set-sub-site-in-read-only-mode.html
https://social.msdn.microsoft.com/Forums/en-US/1f836da6-88ea-4d88-9e43-3383d139ca01/what-is-the-idea-of-stop-inheriting-permission-from-parent-site?forum=sharepointdevelopment
Best Regards
Dennis Guo
TechNet Community Support -
Why do I have to logon each time when opening a office Document from a SharePoint 2010 Library
Hello guys,
I'm facing some design issue with sharepoint 2010 and Microsoft office, hope you can help me to fix this.
Why do I have to logon each time when opening a office Document from a SharePoint Library when I'm already authenticated via the browser?
Please help me to skip this authentication when i try to open office documents from sharepoint library.
Thanks
Jeyaraman SHi Jeyaraman, in addition to Alex's solution, check the following browser settings:
Make sure “Enable protected mode” in security tab & “Require server verification” in “sites” area are unchecked. In “Custom level,” choose “Automatic logon” way at the bottom.
cameron rautmann -
Is PowerPivot client required to connect Excel to a PowerPivot document stored in SharePoint 2010
We are running SharePoint 2010 Enterprise and SQL Server 2008 R2 Enterprise. If we publish a PowerPivot document to SharePoint (in essence creating an SSAS cube on the server), does a client user with Excel need to have the PowerPivot add-in
installed in order to browse the cube through a PivotTable through an ODC connection?Hi,
Please refer to the following sections which describe the ways you can co-author by using Office 2010 and Office Web Apps, and best practices when using libraries to maintain the files.
https://support.office.com/en-us/article/Document-collaboration-and-co-authoring-71c24e30-1313-420f-b36c-9fcc1bf8f8fe?ui=en-US&rs=en-US&ad=US#__toc248301773
Excel 2010 is not included in the table while you need to install Office Web App to use Excel online to achieve co-authoring.
Regards,
Rebecca Tu
TechNet Community Support -
How to Archive a list in sharepoint 2010
Hi
I think large list is the inevitable trend and will be a very common issue faced by everyone. We are a medium business using sharepoint 2010.
For past 3 years, one of our SharePoint lists is over 20000 items.
From my end:
1. I have indexed some important columns and created filtered views but it does not help much.
2. I have increased the list threshold value to 25000( Even though the best practice is 5000).
3. Also, I have set the list template size to 500MB
4. When I try to save the list as a template, SharePoint throws an exception error.
5. I tried working on the code
mentioned in the link
below but it looks complicated for me.
http://spboom.com/sharepoint-development/moving-sharepoint-list-items-to-archive-list/
What I need:
I need to archive old items in the list. After archiving, I might need to refer to the archived items from time to time.
As I'm newbie to SharePoint, it would be great, if someone can elaborate in detail with what can be done.
Again your help in this is much appreciated.
Thanks & Regards,
SweRWhat vesion of SharePoint are you using? If you want to move items across from one list to another (as per your prefered option), something like: -
Create a list template of you list with no content
Recreate it on the same level as the main lis
Create an SPD workflowthat'll copy an item to the new list and delete the original. Make sure it doesn't have a triggering action
Use an Expiration Information Rights Policy to triger the workflow.
Please note that this won't preserve the original author / create metadata as Alex has already said.
Cheers,
Steven Andrews
SharePoint Business Analyst
Blog:
Steve's SharePoint Space Twitter:
LinkedIn:
Facebook:
Note: Posts are provided “AS IS” without warranty of any kind, either expressed or implied, including but not limited to the implied warranties of merchantability and/or fitness for a particular purpose. -
How to Create Custom List in SharePoint 2010 Programmatically ?
Hi,
i have tried the following way,
http://devendra-sharepoint.blogspot.in/2012/01/creating-list-programatically-in_30.html
But i am not able to create list.
Becuase i am getting the following error.
'Microsoft.SharePoint.SPWeb' does not contain a definition for 'EnsureList' and no extension method 'EnsureList' accepting a first argument of type 'Microsoft.SharePoint.SPWeb' could be found (are you missing a using directive or an assembly reference?)
Please advice.
Thanks,
AasaiHi,
You can use list.Fields.Add() to add column in list. See below blog:
http://www.c-sharpcorner.com/blogs/3764/create-sharepoint-list-programmatically.aspx
Use this to delete list:
http://www.c-sharpcorner.com/UploadFile/54db21/delete-list-in-sharepoint-2010-programmatically-using-vs-201/
See this for remove user/group from list:
http://www.c-sharpcorner.com/UploadFile/54db21/remove-group-permission-to-list-in-sharepoint-2010-programma/
Hope it could help
Hemendra: "Yesterday is just a memory,Tomorrow we may never see"
Whenever you see a reply and if you think is helpful, click "Vote As Helpful"! And whenever
you see a reply being an answer to the question of the thread, click "Mark As Answer
Maybe you are looking for
-
Can anyone throw any light on this obscure Flex error?... TypeError: Error #1009: Cannot access a property or method of a null object reference. at mx.controls::AdvancedDataGrid/findHeaderRenderer()[...path...\projects\datavisualisation\ src\mx\contr
-
Hi All, we created a LimitPO and we want to close the same in SRM. How do I close the limit PO in SRM, we have unchecked the invoice expected check box in following documents tab in item details, and also in item details tab, we have maintained no fu
-
Forms , Reprots10g Deployment on Web Logic Server
Currently, I am hosting my Forms and Reports 10g on Oracle Application Server 10g on Redhat Linux AS 4. How would I host Forms and Reports 10g on Web Logic Server? regards
-
Seeking advice on SAP/cloud
Hello all, Will be doing proof-of-concept on SAP on cloud, installing ERP and seeking advice/feedback. Based on the criteria of easier installation and faster delivery (and of course success story), what will be the recommended combination of platfor
-
Trick for Pairing Bluetooth Keyboard and Mouse With Windows 7 in BC 3.1
My Mac: Mid-2007 iMac 20", 2.4 GHz; OS X 10.6.2; Windows 7 Home; Boot Camp 3.1 My Problem: No matter what I tried, including all kinds of tips and tricks found in this forum and elsewhere on the web, I could not get my Apple aluminum bluetooth keyboa