How can I use FTP to move files between directories?

后端 未结 9 1849
日久生厌
日久生厌 2020-12-05 02:47

I have a program that needs to move a file from one directory to another on an FTP server. For example, the file is in:

ftp://1.1.1.1/MAIN/Dir1
相关标签:
9条回答
  • 2020-12-05 03:46

    MSDN seems to suggest that your path is considered relative, and therefore it tries to log in to the FTP server using the supplied credentials, then sets the current directory to the <UserLoginDirectory>/path directory. If this isn't the same directory where your file is, you'll get a 550 error.

    0 讨论(0)
  • 2020-12-05 03:47

    The code looks correct. So either you have the wrong path, the file DOESNT exist or you need to respect case (obviously Windows is not case sensitive, but Linux, Unix are).

    Did you try to open the file in a browser? Open Windows File Explorer and type the address in the path bar and see what you get.

    0 讨论(0)
  • 2020-12-05 03:51

    I was able to get this working but only by using the path as it exists on the server, ie /DRIVELETTER:/FOLDERNAME/filename in RenameTo = "

    0 讨论(0)
提交回复
热议问题