Posted on: 12/10/2014 10:08:11 PM | Views : 454

I used FileUpload control to upload a file from local computer and did something from the file and then insert the data into SQL server database.
I saved the file I uploaded in a server folder which is also a folder of my ASP.NET project folder(using C#).
I used FileUpload.SaveAs(fullpath).
After I insert the data into DB, I want to delete that file from the server,  I used
System.IO.File.Delete(fullpath).
the code works but it did not delete the file from server. I am wondering if it is correct to use System.IO.File.Delete(file) to delete the file. Is there other ways to do that?

Thanks.

Go to the complete details ...