I am ftp’ing files from an external server, then deleting them on the external server, and one file failed because there was a space in the filename. I changed my ftp delete command to have quotes around the filename.
ftpStream.WriteLine('delete ''' & FileToDelete & '''')
But, are there other characters that a user might use in their filename creation, that my program will still choke on? I don’t have any control what those filenames might be.
(I put a tag of SSIS and SQL Server, because I’m creating the ftp task on the fly, from an SSIS pakcage. OS on both sides are Win XP)
Any characters that are reserved by the file system won’t be allowed. This usually includes spaces, commas, slashes, colons, quetion marks, double quotes, etc. But as JaredPar mentioned, space is probably the only universal offender since each file system has its own set of reserved characters that don’t always overlap.
its a good idea to url encode any ftp or http paths. This will convert spaces to %20 which typically should be understood by the ftp server.