Click here to Skip to main content
15,910,234 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
Hi! i want to delete the perticular uploaded file in folder in asp.net.
also provide me the code for deleting the perticular file from the folder.
Posted
Updated 1-Apr-12 2:18am
v2
Comments
fjdiewornncalwe 30-Mar-12 10:14am    
You'll need to provide us a little more information for us to give you a proper, comprehensive answer.

Deleting a file, assuming the app pool account has permissions, is easy.

C#
System.IO.File.Delete(pathToFile);
 
Share this answer
 
C#
if( System.IO.File.Exists( "FilePathGoesHere" )
{
   System.IO.File.Delete( "FilePathGoesHere" );
}


If this isn't what you want, then you'll need to use the Improve Question widget and provide us a little more information.
 
Share this answer
 
HI
C#
string Yourfilename ="test.txt";
 File.Delete( Server.MapPath( "~/filuupload/" +Yourfilename));


Best Regards
M.Mitwalli
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900