What characters are prohibited by the ftp Delete command?

I am processing files from an external server and then deleting them to an external server and one file does not work because there is a space in the file name. I changed the ftp delete command to have quotes around the filename.

ftpStream.WriteLine("delete """ & FileToDelete & """")

      

But are there other symbols that the user can use when creating their files that my program will suffocate anyway? I have no control over what filenames might be.

(I put the SSIS and SQL Server tag because I create an ftp task on the fly, from the SSIS pakist. The OS on both sides is Win XP)

+1


source to share


2 answers


Any characters reserved by the file system will not be allowed. Typically they are spaces, commas, forward slashes, colons, quetion marks, double quotes, etc. But, as JaredPar mentioned, space is probably the only generic offender, as each filesystem 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 converts spaces to% 20, which the ftp server should generally understand.

+2


source


See section 5.3 FTP RFC (RFC 959) . There are actually no illegal characters other than CrLf, which are illegal as part of the filename.



The problem is knowing what characters on the destination server will be suppressed versus illegal FTP characters. I am guessing that apart from space, there are not many symbols that will cause the problem. But I'm not an FTP expert.

0


source







All Articles