开发者

Getting path of the file that saved on Sharepoint Document library

开发者 https://www.devze.com 2022-12-28 18:04 出处:网络
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

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
    }
}  
0

精彩评论

暂无评论...
验证码 换一张
取 消