Can't connect to FTP: (553) File name not allowed

前端 未结 10 2022
别那么骄傲
别那么骄傲 2020-12-03 11:36

I need to FTP a file to a directory. In .Net I have to use a file on the destination folder to create a connection so I manually put Blank.dat on the server using FTP. I che

相关标签:
10条回答
  • 2020-12-03 12:06

    I saw something similar to this a while back, it turned out to be the fact that I was trying to connect to an internal iis ftp server that was secured using Active Directory.

    In my network credentials I was using new NetworkCredential(@"domain\user", "password"); and that was failing. Switching to new NetworkCredential("user", "password", "domain"); worked for me.

    0 讨论(0)
  • 2020-12-03 12:06

    I had this problem when I tried to write to the FTP site's root directory pro grammatically. When I repeated the operation manually, the FTP automatically rerouted me to a sub-directory and completed the write operation. I then changed my code to prefix the target filename with the sub-directory and the operation was successful.

    0 讨论(0)
  • 2020-12-03 12:14

    Mine was as simple as a file name collision. A previous file hadn't been sent to an archive folder so we tried to send it again. Got the 553 because it wouldn't overwrite the existing file.

    0 讨论(0)
  • 2020-12-03 12:16

    your directory has access limit.
    delete your directory and then create again with this code:

    //create folder  
    FtpWebRequest request = (FtpWebRequest)FtpWebRequest.Create("ftp://mpy1.vvs.ir/Subs/sub2");
    request.Method = WebRequestMethods.Ftp.MakeDirectory;
    request.Credentials = new NetworkCredential(username, password);
    request.UsePassive = true;
    request.UseBinary = true;
    request.KeepAlive = true ;
    using (var resp = (FtpWebResponse)request.GetResponse())
    {
    
    }
    
    0 讨论(0)
提交回复
热议问题