0

I am gettong an error "The remote server returned an error: (553) File name not allowed" but i do not know what i have done wrong .Btw, i am using synology NAS as an ftp server . i don't know if the problem is the code or the ftp server

Dim request As System.Net.FtpWebRequest = DirectCast(System.Net.WebRequest.Create("ftp://nasserver/mis/try.txt"), System.Net.FtpWebRequest)
            request.Credentials = New System.Net.NetworkCredential("Admin", "Marga@2016")
            request.Method = System.Net.WebRequestMethods.Ftp.UploadFile
            Dim file() As Byte = System.IO.File.ReadAllBytes("C:\Users\kizzbonez\Documents\a.txt")

     Dim strz As System.IO.Stream = request.GetRequestStream()

       strz.Write(file, 0, file.Length)
            strz.Close()
            strz.Dispose()
  • Show us [`FtpWebRequest` log](https://stackoverflow.com/q/9664650/850848) + Show us a log file on some FTP client (e.g. WinSCP) proving that you can upload the `C:\Users\kizzbonez\Documents\a.txt` to `/mis/try.txt` on `nasserver` using the same credentials. – Martin Prikryl Jun 23 '17 at 05:10
  • Did you use Filezilla or other ftp client to try to upload an test file to the NAS? – Pedro Polonia Jun 23 '17 at 06:24
  • I would be guessing that your synology disk drive is does not use FAT or NTFS as its filesystem and wont recognize "c:". Try omitting that. If your NAS is just seen externally as a single drive, then omitting the drive name and using the path you have will start at the base directory your user account has access to because of the first "\". – David Wilson Jun 23 '17 at 12:30

0 Answers0