image In einem meiner letzten Projekte bin ich in die “glückliche” Lage gekommen, mit einer VAX über FTP zu kommunizieren. Gegen unser IIS7 FTP hatten alle Tests super funktioniert. Ich verbinde mich gegen den Server und mache dann einen Upload mit der Angabe der vollen URI:

Connect: ftp.servername.com

Upload File: /upd/knr/abc/request.txt

Mein erster Code nutzte die native C# FTP Api und antwortet einfach nur mit einem Fehler ohne Details. Ich habe dann auf eine Komponente von Aspose zurückgegriffen (wir nutzen Aspose.NET Total, was ich nur empfehlen kann). Ich bekam folgende Fehlermeldung:

Aspose.Network.Ftp.FtpException: Failed to upload file :500 %CLI-W-IVQUAL, unrecognized qualifier - check validity, spelling, and placement
at Aspose.Network.Ftp.FtpClient.Upload(Stream localStream, String remoteFilePath)
at Aspose.Network.Ftp.FtpClient.Upload(String localFilePath, String remoteFilePath)
at Ibu.Core.Utility.Ftp.UploadFile(String localFilename, Boolean append) in C:UsersscheelCodeProjectXCoreUtilityFtp.cs:line 403
at ConsoleApplication1.Program.Main(String[] args)

Eine kurze Recherche brachte tatsächlich ein Ergebnis:
http://www.physiology.wisc.edu/comp/docs/mg/ftp_users_guide.html

> > If the remote file specification includes ``/'', it will be necessary to enclose the entire remote file specification in double quotes, because the FTP command interpreter interprets ``/'' as the beginning of a qualifier. Notice the difference in behavior on some systems if the remote file specification is and is not quoted. > >

Meine Lösung: Ich habe den führenden Slash einfach weg gelassen und schon hat es funktioniert.

Ciao Marco