Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>The answer described above wasn't working for me. Neither did these work for me:</p> <ul> <li><a href="http://support.microsoft.com/kb/2134299" rel="nofollow">http://support.microsoft.com/kb/2134299</a></li> <li><a href="http://social.msdn.microsoft.com/Forums/en/netfxnetcom/thread/0e5718a4-8b26-4bc4-b9e6-c4faebfc66ae" rel="nofollow">http://social.msdn.microsoft.com/Forums/.....</a></li> <li><a href="https://connect.microsoft.com/VisualStudio/feedback/details/621450/problem-renaming-file-on-ftp-server-using-ftpwebrequest-in-net-framework-4-0-vs2010-only" rel="nofollow">https://connect.microsoft.com/VisualStudio/feedback/.....4-0-vs2010-only</a></li> </ul> <p>What actually happened in my case that the complete path where I wanted my file moved to was added to the old path as if was a relative location from the files current location. e.g. I have a file at <a href="ftp://127.0.0.1/usr/john/temp/file.fmf" rel="nofollow">ftp://127.0.0.1/usr/john/temp/file.fmf</a> and I want to move it to <a href="ftp://127.0.0.1/usr/mary/archive/file.fmf" rel="nofollow">ftp://127.0.0.1/usr/mary/archive/file.fmf</a>. I used (and this this worked in .Net Framework 3.5 and before):</p> <pre><code> FtpWebRequest ftp = (FtpWebRequest)FtpWebRequest.Create(new Uri("ftp://127.0.0.1/usr/john/temp/file.fmf")); ftp.Credentials = new NetworkCredential(this.UserName, this.Password); ftp.KeepAlive = true; ftp.UsePassive = true; ftp.Method = WebRequestMethods.Ftp.Rename; ftp.RenameTo = "usr/mary/archive/file.fmf"; ftp.UseBinary = true; FtpWebResponse response = (FtpWebResponse)ftp.GetResponse(); </code></pre> <p>But not in .Net Framework 4.0. In the System.Net trace I found I was trying to replace the file to usr/john/temp/usr/mary/archive/file.fmf. This location didn't exist indeed. So I changed the RenameTo into a relative path:</p> <pre><code> ftp.RenameTo = "../../mary/archive/file.fmf"; </code></pre> <p>And again, the file was moved to it new location.</p> <p>Although I see this merely as work around, not as solution and although I have no idea to really solve it, I am glad it is working again.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload