Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C# FTP
Hi,
 
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.
 
Thx
 
macrene
Posted 13-Jun-12 6:37am
macrene115
Rate this: bad
good
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.
  Permalink  
Comments
macrene at 14-Jun-12 10:07am
   
I solved it, before I read your answer, so thank you very much in anyway.
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2

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

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

  Print Answers RSS
0 Sergey Alexandrovich Kryukov 428
1 CHill60 310
2 BillWoodruff 183
3 DamithSL 163
4 OriginalGriff 163


Advertise | Privacy | Mobile
Web01 | 2.8.141022.1 | Last Updated 14 Jun 2012
Copyright © CodeProject, 1999-2014
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