Click here to Skip to main content
16,012,061 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi;

I want to copy a file from FTP server folder to another folder on the same ftp server.
any help would be appreciated.
thanks.
Posted

1 solution

There is no such FTP operation, so the solution is to read the file into internal buffer (or a temporary file using System.IO.Path.GetTempFileName, see http://msdn.microsoft.com/en-us/library/system.io.path.aspx[^] and copy it onto a new file in another directory using FTP.

To work with FTP, you will need to use System.Net.FtpWebRequest and System.Net.WebRequestMethods.Ftp, see:
http://msdn.microsoft.com/en-us/library/system.net.ftpwebrequest.aspx[^],
http://msdn.microsoft.com/en-us/library/system.net.webrequestmethods.ftp.aspx[^].

—SA
 
Share this answer
 
Comments
Tanzy123 26-Dec-11 5:46am    
Thanks
SAKryukov
Tanzy123 26-Dec-11 7:38am    
Hi;
M now using "RENAME", to move file from one directory to another, but how can i check whether the file already exists there or not?
Thanks

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