private bool CheckFileExistance(string filePath) { // it will return true if file is available or false if file is not available //use this if your file path will like this.... C:\test.txt //filePath = "C:\PDF\test.pdf" then use this.... return System.IO.File.Exists(filePath); //path like C:\test.txt ///////////////////OR//////////////////////// //use this if your path is like ~/PDF/test.pdf.. //so if your pdf files where store in pdf directory then use this method for getting path //Server.MapPath("~/PDF/test.pdf") //filePath = "~/PDF/test.pdf" then use this.... return System.IO.File.Exists(Server.MapPath(filePath)); }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)