0

I have to copy some files from ftp to another remote desktop computer. I am doing this as:

File.Copy("ftp://IPAddress:Port/MyFolder/MyFile.dll", @"IPAddress\MyLocation");

But this is not working. I think, it happened because the folder in the remote desktop where i have to paste my file is not a shared folder.

so , i want to know how can we copy files from ftp to remote desktop folder which is not shared?

also, the ftp and remote desktop requires the credentials (Password). pls also tell me how can i handle credentials in my code?

TheBoyan
  • 6,802
  • 3
  • 45
  • 61
harish kumar
  • 31
  • 1
  • 6
  • Have you tried using drive$ for the IPAddress\MyLocation? i.e. C$ will give you access to remote pc's C: drive – Bali C Jan 05 '12 at 10:18
  • 1
    Even this question in SO has sample code in it. http://stackoverflow.com/questions/2781654/ftpwebrequest-download-file – Shoban Jan 05 '12 at 10:19

1 Answers1

1

The System.Io.File class does not support URI's or the FTP protocol, only access to local file system and shared folders.

Please check out this article on how to upload files with FTP using the .NET Framework.

Nilzor
  • 18,082
  • 22
  • 100
  • 167
  • i have successfully download file from FTP using ftpwebrequest and ftpwebresponse classes. Now, i have to paste this file to the folder of a remote server PC and this folder is not Shared. Is it possible? – harish kumar Jan 11 '12 at 11:14
  • This has nothing to do with folder sharing. FTP is a separate protocol that needs a separate server application like for instance Serv-U (Windows) or proftpd (Linux). See http://en.wikipedia.org/wiki/FTP and http://en.wikipedia.org/wiki/Comparison_of_FTP_server_software – Nilzor Jan 12 '12 at 08:08