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

前端 未结 10 2066
别那么骄傲
别那么骄傲 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 11:57

    I hope this will be helpful for someone

    if you are using LINUX server, replace your request path from

    FtpWebRequest req= (FtpWebRequest)WebRequest.Create(@"ftp://yourdomain.com//yourpath/" + filename);
    

    to

    FtpWebRequest req= (FtpWebRequest)WebRequest.Create(@"ftp://yourdomain.com//public_html/folderpath/" + filename);
    

    the folder path is how you see in the server(ex: cpanel)

提交回复
热议问题