Click here to Skip to main content
15,903,362 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hello friends,

I am developing a window application in c#.net. I want to delete only those file that was just uploaded to FTP server.
Posted
Comments
[no name] 20-Mar-15 1:32am    
You need to be more specific - we can't read your mind :)
How would your application be able to identify which files were just uploaded?
Do you upload the files with an FTP-Client that you wrote yourself? Or with an FTP-Client that you got from somewhere? Or is the application you mention here the FTP-Client?
Brinda Lakhani 20-Mar-15 2:10am    
I gave the file name of system_name+system_time.
Joan Magnet 20-Mar-15 4:29am    
Do you know wich files has been uploaded?
Herman<T>.Instance 20-Mar-15 12:05pm    
he must otherwise the upload fails!
Joan Magnet 20-Mar-15 12:22pm    
Then simply use Directory.GetFiles method to get a list and File.Delete with each file.

1 solution

One way to organize the file delete option is as soon as your file upload is completed, since you still have local file path, Use
C#
File.Delete("FilePath")
. That should pretty Much take care of the issue.
 
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