login about faq

Hello,

Yesterday I started to evaluate FTP2 ActiveX for a VB6 application. We need to copy a tree to our remote server, so I am testing the methods "PutTree" and "SyncRemoteTree". I also tested the "PutFile" method. All folders and files are uploaded, but in all cases tested, if I have files with accentuation (ã, á, õ, ç, etc), the destination file is uploaded with strange characters (razões -> razões).

The charset is correctly set to utf-8 using the property "DirListingCharset", and I can see it also in the logging: FEAT 211-Extended features supported: LANG EN* UTF8 AUTH TLS;TLS-C;SSL;TLS-P; PBSZ PROT C;P; CCC HOST SIZE MDTM REST STREAM 211 END

Otherwise, if I upload the same files using Filezilla, the names stay as the original ones.

What else can I do to keep the original names of my files?

Thanks in advance for any help.

Isis Nobre Brazil

asked May 16 '13 at 10:14

Isis's gravatar image

Isis
6223


The fact that õ is showing up as 2 chars (õ) indicates that Chilkat correctly sent the õ using utf-8 but the server interpreted the bytes as ANSI (1-byte per char). In utf-8, õ is 2 bytes. Therefore if Chilkat sends õ in utf-8, it is sending 2 bytes for that char. If the server is interpreting the bytes as ANSI (1-byte per char), then you'll see whatever ANSI chars are represented by each of those bytes.

In summary, it seems the server really needs ANSI. Therefore, set the DirListingCharset property = "ANSI".

link

answered May 16 '13 at 16:55

chilkat's gravatar image

chilkat ♦♦
11.8k316358421

Hello,

Thank you very much for your help! I did the change and now I can send those characters correctly!

I only would like to suggest a review in the component documentation, complementing it with your expstrong textlanation above, because I read the descriptions N times and only could understand that I needed to use UTF-8 for handling these non-English characters:

PutFile(localFilePath As String, remoteFilePath As String) As Long Uploads a local file to the current directory on the FTP server.

If the remoteFilePath contains non-English characters, it may be necessary to set the DirListingCharset property equal to "utf-8". Please refer to the documentation for the DirListingCharset property.

Returns 1 for success, 0 for failure.


DirListingCharset As String Set to "ansi" by default. If the FTP server sends directory listings with non-English filenames, this property can be set to the appropriate value if necessary.

Note: This property also applies to all FTP operations where a filename or path is sent over the command channel, such as when uploading or downloadiing files. If the remote file path uses non-English characters, such as Chinese, it is likely that this property should be set to "utf-8" so that these characters are sent correctly.

Regards, Isis

link

answered May 21 '13 at 09:31

Isis's gravatar image

Isis
6223

Hi There

I'm having the same issue. I have files to ftp over with german characters in them and the german chars become unreadable after the transfer. if use the anscii they german char get deleted! from the file name, if i use the utf-8 they get replaced with scribbles. So whichever encoding I'm using it doesn't work. Filezilla can upload them without any change in the characters. Could you please advise what to try next? Regards,N0rthp0le

link

answered Jan 10 '14 at 10:12

N0rthp0le's gravatar image

N0rthp0le
1222

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or __italic__
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Tags:

×131
×90

Asked: May 16 '13 at 10:14

Seen: 1,967 times

Last updated: Jan 10 '14 at 10:12

powered by OSQA