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

Is there someway to get the actual modified date of a file in a document library. Modified field has the modified date for the item and not the file so if one of the meta data of the file changes the modified field changes. Is it possible to use Property Promotion or something when uploading the file to get this property into some column?

share|improve this question

2 Answers 2

up vote 2 down vote accepted
  • Add a field to your list: "Document Last Modified"
  • Create an event receiver, easiest probably to override SPItemEventReceiver.ItemUpdated

http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.spitemeventreceiver.itemupdated.aspx

  • Then you will need to update the field ("Document Last Modified") with the value:

SPItemEventProperties.ListItem.File.Properties["vti_lmt"]

You can find out other document properties using this powershell (or convert to c#)

(get-spsite "http://yoursite").RootWeb.Lists["Shared Documents"].Items |% {
    $file = $_; 
    $file.Properties.Keys |% {
        Write-Host $_ "=" $file.Properties[$_] 
    }
}
share|improve this answer

I think the only way you could achieve this by creating an event receiver in code.

So you could check every time a document is uploaded or modified check the time of the file and set it to a desired column

just an idea :)

you can find some info about event receivers here.

share|improve this answer

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.