I have a folder which contains several PDF files and inserting and viewing all these pdf's are dont by 2 methods. I have to move this folder to place this folder outside of the project file. Therefore I have to use the absolute path. I have tried some coeds in the internet but none of them worked for me.
Following code is in a button clcik event
string directoryPath = @"D:\competion\pdfFolder\";
string svrPath = Server.MapPath(directoryPath);
DataSet ds = new DataSet();
string extension = Path.GetExtension(FileUpload1.FileName);
if ((FileUpload1.HasFile))
{
if (extension == ".pdf")
{
if (grdPolicyDetails.Rows.Count > 0)
{
//Few methods are invoked in the body
}
}
}
There are else parts in the if else statements but i haven't added those codes.