1

How can I use FTP to move files between directories?

I were trying to use the webrequest object to move a folder, say

move data/current

to data/previous/1/

however when i try to do it simply by setting source folder as source, target folder as destination, i have got the exception

The request URI is invalid for this FTP command.

should i not be doing that at all? how should i achieve this objective neatly?

Community
  • 1
  • 1
nokheat
  • 1,167
  • 4
  • 14
  • 23

1 Answers1

1

I have found that I get this error when the request URI has a trailing slash (even if it is a directory). Try removing the last slash on data/previous/1/.

Matt Winckler
  • 2,223
  • 2
  • 23
  • 27