I have password-protected a folder on my web server using CPanel (HTTP?). I am trying to upload a file via FTP in C#, but I keep getting this error:
The remote server returned an error: (553) File name not allowed.
When I use the same code to upload to a non-password protected folder I don't get any errors. There is nothing wrong with the file name as far as I can tell.
So what would the problem be? How do I supply credentials to the password-protected folder (not talking about the FTP credentials, because obviously those are authenticating properly if a 553 error code is being returned)?
I realized what the problem was (it was totally unrelated to password-protection). The root directory for the FTP account I was using was actually a sub-directory inside another directory. The directory I was trying to access was:
www.example.com/example1/abc/
But the highest directory that the FTP account had permissions to was:
www.example.com/example1/
So I was specifying /example1/abc as the directory to upload the file to, where as should it should have simply been /abc/, since it is all relative to the FTP account's root directory and not the root of the entire domain. So I was authenticating correctly, but because I was specifying the wrong relative directory the 553 error code was being returned.
Newbie mistake. ;)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With