T
troy
Hello,
I have the following code that run in the page_load section:
private void Page_Load(object sender, System.EventArgs e)
{
/// Create uploads folder in the Virtua; directory if one doesnt exist
AppPath = Request.PhysicalApplicationPath + UploadDirectory;
if(!Directory.Exists(AppPath))
Directory.CreateDirectory(Request.PhysicalApplicationPath +
UploadDirectory + "\\");
if(File.Exists(AppPath+"\\uploaded.txt"))
File.Delete(AppPath+"\\uploaded.txt");
}
The File.Delete command throws an except if the uploaded.txt file exists in
the application path\uploads folder - i guess because it has no permissions
on on it. How do I over come this?
thanks
I have the following code that run in the page_load section:
private void Page_Load(object sender, System.EventArgs e)
{
/// Create uploads folder in the Virtua; directory if one doesnt exist
AppPath = Request.PhysicalApplicationPath + UploadDirectory;
if(!Directory.Exists(AppPath))
Directory.CreateDirectory(Request.PhysicalApplicationPath +
UploadDirectory + "\\");
if(File.Exists(AppPath+"\\uploaded.txt"))
File.Delete(AppPath+"\\uploaded.txt");
}
The File.Delete command throws an except if the uploaded.txt file exists in
the application path\uploads folder - i guess because it has no permissions
on on it. How do I over come this?
thanks