Hoe开发者_如何学C to get the full path of the file that saved on into sharepoint document library. I have one requirement, in this if i upload one file to the document library, then i want to save the Doc path of the same to the DB. please help me to implement this task. Thanks in advance..
You can write some code to ItemAdded event handler and deploy it as a feature:
public override void ItemAdded(SPItemEventProperties pobjSPItemEventProperties)
{
using (SPWeb objSPWeb = pobjSPItemEventProperties.OpenWeb())
{
string strFileUrl = pobjSPItemEventProperties.ListItem.File.Url;
//save to DB here
}
}
精彩评论