I'm trying to move files from a folder into it's parent folder.
I had issues moving files before, something to do with absolute versus relative path on the RenameTo
property. I'm currently getting a 553 error(file name not allowed).
Files are in "//blah/John/Update/Done/" and I'd like to move to "//../Update/".
Here is a snippet of the code I'm using:
string ftpConn="ftp://blah/John/Update/";
for (int i = 0; i < fileList.Count; i++ )
{
var requestMove = (FtpWebRequest)WebRequest.Create(ftpConn + "Done/" + fileList[i].fName);
requestMove.Method = WebRequestMethods.Ftp.Rename;
requestMove.Credentials = new NetworkCredential(ftpUser, ftpPass);
requestMove.RenameTo = ".../John/Update/" + fileList[i].fName;
requestMove.GetResponse();
}
I've tried changing the RenameTo
property to the absolute path and it still gives me the same error.