I am checking the file exist in a folder but i am getting every time false. In that folder i have file.
code
-------
string filename = ((Label)e.Item.FindControl("Label2")).Text;
string filePath = @"Uploads\Master\MyDocsFiles\" + filename;
bool fileavail = File.Exists(filePath) ? true : false;
if (fileavail) {
Response.AddHeader("Content-Disposition", "attachment;filename=\"" + filePath + "\"");
Response.TransmitFile(Server.MapPath(filePath));
Response.End();
}
else
{
fileexist.Visible = true;
}
That is the code. Please give me the solution
Jignesh KumarPosted Nov 26, 2018, 11:54 PM
Harish BatchuPosted Nov 27, 2018, 12:08 AM
Harish BatchuPosted Nov 26, 2018, 11:45 PM
Kalyani ShevalePosted Nov 26, 2018, 10:46 PM