Click here to Skip to main content
12,690,140 members (25,672 online)
Rate this:
Please Sign up or sign in to vote.
See more: C# FTP

I'm coding in Visual C#. One task is to uplaod a file to an ftp-Server. In the filename # have to be used. Uploading the files with a *.bat works fine, but doing it in my app leads to filename on the ftp-Server, where only the letters before the first appearance of # is used.

In the debugger the ftp-path inclusive filename is shown correctly.

Any suggestions welcomed.


Posted 13-Jun-12 7:37am
Rate this: bad
Please Sign up or sign in to vote.

Solution 1

It seems to be an encoding issue, or the FTP client class you use has a bug. What are you using? Have you tried the same path name using a normal FTP client? If it works trace the communication with a network sniffer, and see how it is encoded. Trace your app also and see the difference. Theoretically hashmark is allowed by the RFC. But be aware that FTP is not UTF-8 compliant, only when complies with RFC 2640.
macrene 14-Jun-12 10:07am
I solved it, before I read your answer, so thank you very much in anyway.
Rate this: bad
Please Sign up or sign in to vote.

Solution 2

Instead of "#" in the FTP-path "%23" must be used.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy | Mobile
Web01 | 2.8.170117.1 | Last Updated 14 Jun 2012
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100