User-1651858287 posted
The supervisor can create a pdf file from a database.
The problem is after the file is created others user can access the pdf directly.
At url.pdf.
I want to murder url.pdf after 30 minutes. Thus no one can access it since its does not live anymore.
I do not have any experience doing this any ideas and suggestions would help.
Thanks.
//create file code above
//open file
string path = ResolveClientUrl("~/Appraisal/" + Empl.SelectedValue + ".pdf");
string encodedPath = System.Web.HttpUtility.JavaScriptStringEncode(path, true);
ClientScript.RegisterStartupScript(this.GetType(), "open", "window.open(" + encodedPath + ", '_blank');", true);
}
//delete file
string location = Server.MapPath("~/Appraisal");
string delFile = location + "/" + Empl.SelectedValue + ".pdf";
try
{
File.Delete(delFile);
}
catch (IOException iox)
{
Response.Write(iox.Message);
}