Questions tagged [document-library]
170 questions
16
votes
8 answers
How to get the Absolute URL of a file in sharepoint library
I am working on SharePoint 2010.I have an documentlibrary ID and document ID in that library with me.i don't have either web,site in which the document library is present.So now I have to get the Full URL of the document at runtime.How can I get it…

Tortoise
- 731
- 4
- 10
- 21
9
votes
3 answers
Find latest approved version of an SPListItem
I am trying to iterate through the SPListItem.Versions collection to find the latest approved list item.
My list item has three versions: the first two are approved, the last is in draft. But my code says they're all in draft! Please help!
//…

Martin Larsson
- 720
- 2
- 10
- 21
8
votes
4 answers
How to efficiently delete all files in a document library?
I am looking for a clear, complete example of programmatically deleting all documents from a specific document library, via the Sharepoint object model. The doclib does not contain folders. I am looking to delete the documents completely (ie I…

Paul Lalonde
- 5,020
- 2
- 32
- 35
7
votes
2 answers
Dynamically display Edit Control Block menu item in SharePoint
I am trying to set up dynamic per-item menus (Edit Control Block) in SharePoint 2007. My goal is to have certain features that are available based on the current user's group membership.
I know that the CustomAction tag that controls the creation…

Jason Z
- 13,122
- 15
- 50
- 62
7
votes
2 answers
Store documents in file system instead of database in SharePoint document library
In a SharePoint document library, is there any way to store the documents on the file system instead of the database?
ryan
6
votes
1 answer
Change file extension in SharePoint
I'm trying to find out how to change the file extension of a file in a document library in SharePoint, so that a newer version with a different extension can be uploaded without a separated copy being created (e.g. suppose I want to replace a .doc…

Pupper
- 2,315
- 2
- 22
- 29
4
votes
2 answers
How do I rename a file using the SharePoint web services?
I have a custom definition for a document library and I am trying to rename documents within the library using only the out of the box web services. Having defined a view with the "Name" field supplied and trying the "LinkFilename", my calls to…

Nat
- 14,175
- 5
- 41
- 64
4
votes
4 answers
Script to delete files older than a day in Sharepoint document library
I need a script which can delete all files which are older than a day and this script needs to be invoked every day automatically in the Sharepoint server.
How can i do this and any hints as how to write the script?
dhiraj
4
votes
5 answers
How to create a lookup column that targets a Doc Lib and uses the 'Name' of the document?
How do you create a lookup column to a Document Library that uses the 'Name' of the document as the lookup value?
I found a blog post that recommends adding another custom field like "FileName" and then using a item reciever to populate the custom…

stlawrence
- 169
- 1
- 2
- 11
4
votes
2 answers
Using a sharepoint document library, how can I create 'permalinks'?
I want to be able to link to sharepoint documents without having to refer to the document name which may change.
Is there anyway to programmatically add a unique key to the meta-data and then somehow use this in a link?

AndyM
- 3,574
- 6
- 39
- 45
4
votes
2 answers
Monitoring a SharePoint document library
I was wondering if there was a good way to monitor a document library on SharePoint for changes (new files added, files changed / checked-in, files deleted, etc.)
Basically, what System.IO.FileSystemWatcher does on local / network directories.
Are…

Hugo Migneron
- 4,867
- 1
- 32
- 52
4
votes
0 answers
Setting expiration of files in SharePoint in a document library
I got a SharePoint-Site that has images in a special asset-sitecollection. These images have a max-age of "0" by SharePoint default, so won't be cached.
Cache-Control:private,max-age=0
Date:Fri, 23 Nov 2012 10:44:56…

Ole Albers
- 8,715
- 10
- 73
- 166
4
votes
3 answers
Liferay from fileentry to java file object
Anyone know how to retrieve a contentStream from a DLFileEntry (http://docs.liferay.com/portal/6.0/javadocs/com/liferay/portlet/documentlibrary/model/DLFileEntry.html) using an httpservlet?
I tried using DLFileEntry.getContentStream() but it fails…

Sabrina
- 267
- 5
- 18
3
votes
2 answers
New columns are added to content type, but not document library in sharepoint
I add columns to a content type via code. This works quite well (checking this at "site settings - content types - (my content type))
Now I expected that in the document library which has that content type as its parent these columns are also…

Ole Albers
- 8,715
- 10
- 73
- 166
3
votes
3 answers
Organising large Doc volumes in Sharepoint
I need to upload into Sharepoint around 100,000 (MS-Word) documents that are currently on a file server - added over the past 7 years. I've read that a sharepoint Document Library should really be limited to 2,000 documents, and that there are…
user101175