Remark: due to spam prevention mechanizm I was forced to replace the beginning of the Uris from ftp:// to ftp.
I\'ve got following problem. I have to upload file wit
I have encountered a similar issue. The problem is that FtpWebRequest (incorrectly) prepends '/' to rename requests, as can be seen from this log (upload & rename):
URL:
http://127.0.0.1/Test.txt
FTP log:
STOR Test.txt.part
RNFR /Test.txt.part
RNTO /Test.txt
Please note that this problem occurs only when you are uploading to the root directory. If you changed the URL to http://127.0.0.1/path/Test.txt
, then everything would work fine.
My solution to this problem is to use %2E (dot) as the path:
URL:
http://127.0.0.1/%2E/Test.txt
FTP log:
STOR ./Test.txt.part
RNFR ./Test.txt.part
RNTO ./Test.txt
You have to url-encode the dot, otherwise FtpWebRequest would simplify the path "/./" to "/".