Page 1 of 1

FTP or HTTP Download with UTF8

Posted: Tue Feb 03, 2015 3:26 pm
by zinnsoldat08468
Hello,

i woult like to Download a File from FTP but if the filename "ä,ü,ö or ß" than the Download has 0 kb.

Code: Select all

   # Generate local Path
   put "binfile:" & tAppPath & "/" & tFileName into tFileFolder

   # Generate FTP Link
   put "ftp://"& tUser & ":" & tPass & "@" & tIp & ":21/Alfresco/Sites/tür.pdf" into tFTPDownload

   # Download File
   put URL tFTPDownload into URL tFileFolder
This works for file "tuer.pdf" but if i download "tür.pdf" it dosn`t work. Please help me :-)

Regards
Z!nni

Re: FTP or HTTP Download with UTF8

Posted: Tue Feb 03, 2015 4:50 pm
by jmburnod
Hi Zinni,

You maybe need use urlencode()
Try this:

Code: Select all

put urlencode("tür.pdf") into tNameUrl
put "ftp://"& tUser & ":" & tPass & "@" & tIp & ":21/Alfresco/Sites/" & tNameUrl into tFTPDownload
Best regards
Jean-marc

Re: FTP or HTTP Download with UTF8

Posted: Tue Feb 03, 2015 5:02 pm
by Klaus
Hallo Herr Zinnsoldat :D

although it should, maybe the server does not even support this "modern" stuff like UTF8 filenames?
Check this: https://wiki.filezilla-project.org/Character_Set

Did you check with a dedicated FTP client?


Best

Klaus

Re: FTP or HTTP Download with UTF8

Posted: Tue Feb 03, 2015 5:25 pm
by zinnsoldat08468
Thanks Jean-marc but "urlencode" dosn`t work for me.

@Klaus - hallo zurück :-)

i have checked with Filezilla and here is the output:

Code: Select all

Antwort:	215 UNIX Type: Java FTP Server
Befehl:	FEAT
Antwort:	211-Features supported
Antwort:	 MFMT
Antwort:	 SIZE
Antwort:	 UTF8
Antwort:	 MLST size*;modify*;create*;type*;unique*;perm*;media-type*;
Antwort:	 MLSD
Antwort:	 AUTH TLS
Antwort:	211 END
Befehl:	OPTS UTF8 ON
Antwort:	200 OPTS UTF8 ON
Filezilla use "OPTS UTF8 ON" but what can i do, to work with this server?

Regards
Z!nni

Re: FTP or HTTP Download with UTF8

Posted: Tue Feb 03, 2015 6:21 pm
by Klaus
Hi Zinni,

sorry, not the slightest idea...


Best

Klaus

Re: FTP or HTTP Download with UTF8

Posted: Tue Feb 03, 2015 6:30 pm
by zinnsoldat08468
German Umlauts are bad :-)

Re: FTP or HTTP Download with UTF8

Posted: Tue Feb 03, 2015 6:39 pm
by Klaus
zinnsoldat08468 wrote:German Umlauts are bad :-)
Ich sachet Dir! :D

Re: FTP or HTTP Download with UTF8

Posted: Tue Feb 03, 2015 8:17 pm
by jacque
I don't know if this will work, but you could try converting the file path to UTF8:

Code: Select all

put unidecode(uniencode(tFilePath), "UTF8") into tFilePath
After that, you may need to urlEncode it also.

This method is for versions of LC before 7.0. If you are using 7.0 then you probably want the textEncode command instead (see the dictionary.)

Re: FTP or HTTP Download with UTF8

Posted: Wed Feb 04, 2015 9:42 am
by zinnsoldat08468
Thank you very much. "textEncode" has work.

Code: Select all

# Generate FTP Link
put textEncode("ftp://"& tUser & ":" & tPass & "@" & tIp & ":21/Alfresco/Sites/tür.pdf,"UTF-8") into tFTPDownload