.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
 
Sign In
Register
 
Win Surprise Gifts!!!
Congratulations!!!


Top 5 Contributors of the Month
david stephan

Post New Resource Bookmark and Share   

Check File Exist in SharePoint Document Libray

Posted By:abhays       Posted Date: November 08, 2014    Points: 40    Category:    URL: http://www.dotnetspark.com  

Check if the file exists in the document library SharePoint
 

Below code explains how to Check if the file exists in the document library SharePoint

using (SPSite oSite = new SPSite(SIteUrl))
 
{

using (SPWeb oWeb = oSite.OpenWeb())
 
{

string fileName = "Ram_Resume.docx";
 
 string documentLibraryName = "Resumes";
 
 string fileUrl = string.Format("{0}/{1}/{2}", oWeb.Url, documentLibraryName, fileName);
 
 SPFile file = oWeb.GetFile(fileUrl);
 
 if (file.Exists)
 
{


}
 
}

}


     

Further Readings:

Responses

No response found. Be the first to respond this post

Post Comment

You must Sign In To post reply
Here

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend