Getting “(553) File name not allowed” when renaming file on FTP server

前端 未结 1 1852
暗喜
暗喜 2021-01-16 09:23

In my application, I have files in FTP server one directory and I move that file source to target path. In this process, when I move selected source file that source file wi

相关标签:
1条回答
  • 2021-01-16 09:48

    As I wrote you already before:

    request.RenameTo takes a path only.

    So this is wrong:

    string Targetpat =
        "ftp://ftp.com/Mainfoder/DownloadedFiles/"+subfolder+"/"+todaydatefolder+"/"+susubfolder;
    request.RenameTo = Targetpat+"/"+newfilename;
    

    It should be:

    string Targetpat =
        "/Mainfoder/DownloadedFiles/"+subfolder+"/"+todaydatefolder+"/"+susubfolder;
    request.RenameTo = Targetpat+"/"+newfilename;
    
    0 讨论(0)
提交回复
热议问题