FTP file upload with non-ascii characters in filename

Matthias Rebbe matthias_livecode_150811 at m-r-d.de
Thu Mar 2 04:32:44 EST 2017


My problem is solved now.

I found out that
1. it works w/o problems under Windows
2. it works under Mac OS X if i unload/disable tsNET

So i contacted Charles Warwick. This is his answer
—>
"OS X / Linux filesystems are all UTF-8, so you need to convert the filename to UTF-8 format before calling libUrlFtpUploadFile.
Try changing the end of your mouseUp handler to look like this:

...	
	libURLSetStatusCallback "uploadProgress", the long ID of me
	put textencode(tSourceFile, "UTF-8") into tSourceFile
	liburlftpuploadfile tSourceFile,tURL ,”uploadComplete"
...

Let me know if that resolves your issue or not.  It seemed to fix the issue on my Mac.
If it does - since this seems to only be an issue with tsNet loaded - I will modify the libUrl wrapper for tsNet so it automatically does that conversion on those platforms in the next LC version to keep compatibility with those not using tsNet.”
<— 


I´ve added now a switch that  textencodes the source file if the OS is MacOS or Linux. And now it works perfectly.

I know, i know...
Jacqueline already suggested to use textEncode. I did, but for the target file. ;)
I´ve never  have assumed that i have to do it with the source file.

Regards,

Matthias



> Am 28.02.2017 um 18:10 schrieb Matthias Rebbe via use-livecode <use-livecode at lists.runrev.com <mailto:use-livecode at lists.runrev.com>>:
> 
> 
> It seems it´s not a problem with non-ascii in general.
> 
> If i first put the content of the file, which i want to upload and which contains non-ascii chars in its filename, 
> into a variable and urlencode the filename of the target file, then i am able to upload the file using "liburlftpupload tData, tTargetURL" without problems.
> 
> But if i use "liburlftpfileupload tSourceFilePath, tTargetURL” to upload the same file using source file path and target URL, then i get an error.
> It works with files wihtout non-ascii chars in their filenames.
> 
> Is it possible that there is a problem with libURL and non-ascii filenames?
> 
> Regards,
> Matthias
> 
> 
>> Am 28.02.2017 um 17:14 schrieb J. Landman Gay via use-livecode <use-livecode at lists.runrev.com <mailto:use-livecode at lists.runrev.com> <mailto:use-livecode at lists.runrev.com <mailto:use-livecode at lists.runrev.com>>>:
>> 
>> Maybe textDecode(filename) would work.
>> 
>> --
>> Jacqueline Landman Gay         |     jacque at hyperactivesw.com <mailto:jacque at hyperactivesw.com> <mailto:jacque at hyperactivesw.com <mailto:jacque at hyperactivesw.com>>
>> HyperActive Software           |     http://www.hyperactivesw.com <http://www.hyperactivesw.com/> <http://www.hyperactivesw.com/ <http://www.hyperactivesw.com/>>
>> 
>> 
>> 
>> On February 28, 2017 10:01:47 AM Matthias Rebbe via use-livecode <use-livecode at lists.runrev.com <mailto:use-livecode at lists.runrev.com> <mailto:use-livecode at lists.runrev.com <mailto:use-livecode at lists.runrev.com>>> wrote:
>> 
>>> 
>>>> Am 28.02.2017 um 16:36 schrieb Bob Sneidar via use-livecode <use-livecode at lists.runrev.com <mailto:use-livecode at lists.runrev.com> <mailto:use-livecode at lists.runrev.com <mailto:use-livecode at lists.runrev.com>> <mailto:use-livecode at lists.runrev.com <mailto:use-livecode at lists.runrev.com> <mailto:use-livecode at lists.runrev.com <mailto:use-livecode at lists.runrev.com>>>>:
>>>> 
>>>> Is the need because the files already exist, or is it because you cannot control the source of the files? If possible, the files should probably be renamed on the other end to make them "compatible" with all file systems. If not, then maybe urlEncode/urlDecode or the ISO functions may work for you.
>>>> 
>>> 
>>> Thanks Bob. That´s what i am doing right now.
>>> 
>>> As i cannot guarantee that my customer won´t use such filenames, i will implement a function that removes and replaces all characters that are non-ascii.
>>> 
>>> Although, i am wondering how ftp clients like transmit are able to handle such non-ascii characters. Anyway.
>>> 
>>> Regards,
>>> 
>>> Matthias
>>> 
>>>> Bob S
>>>> 
>>>> 
>>>>> On Feb 28, 2017, at 24:23 , Matthias Rebbe via use-livecode <use-livecode at lists.runrev.com <mailto:use-livecode at lists.runrev.com> <mailto:use-livecode at lists.runrev.com <mailto:use-livecode at lists.runrev.com>> <mailto:use-livecode at lists.runrev.com <mailto:use-livecode at lists.runrev.com> <mailto:use-livecode at lists.runrev.com <mailto:use-livecode at lists.runrev.com>>>> wrote:
>>>>> 
>>>>> Hi,
>>>>> 
>>>>> i need to upload files with non-ascii characters in the filename and this has to work on Win and Mac OS X.
>>>>> 
>>>>> <snip>
>>>>> 
>>>>> Regards,
>>>>> 
>>>>> Matthias
>>>>> _______________________________________________
>>>>> use-livecode mailing list
>>>>> use-livecode at lists.runrev.com <mailto:use-livecode at lists.runrev.com> <mailto:use-livecode at lists.runrev.com <mailto:use-livecode at lists.runrev.com>> <mailto:use-livecode at lists.runrev.com <mailto:use-livecode at lists.runrev.com> <mailto:use-livecode at lists.runrev.com <mailto:use-livecode at lists.runrev.com>>>
>>>>> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
>>>>> http://lists.runrev.com/mailman/listinfo/use-livecode <http://lists.runrev.com/mailman/listinfo/use-livecode> <http://lists.runrev.com/mailman/listinfo/use-livecode <http://lists.runrev.com/mailman/listinfo/use-livecode>> <http://lists.runrev.com/mailman/listinfo/use-livecode <http://lists.runrev.com/mailman/listinfo/use-livecode> <http://lists.runrev.com/mailman/listinfo/use-livecode <http://lists.runrev.com/mailman/listinfo/use-livecode>>>
>>>> 
>>>> 
>>>> _______________________________________________
>>>> use-livecode mailing list
>>>> use-livecode at lists.runrev.com <mailto:use-livecode at lists.runrev.com> <mailto:use-livecode at lists.runrev.com <mailto:use-livecode at lists.runrev.com>> <mailto:use-livecode at lists.runrev.com <mailto:use-livecode at lists.runrev.com> <mailto:use-livecode at lists.runrev.com <mailto:use-livecode at lists.runrev.com>>>
>>>> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
>>>> http://lists.runrev.com/mailman/listinfo/use-livecode <http://lists.runrev.com/mailman/listinfo/use-livecode> <http://lists.runrev.com/mailman/listinfo/use-livecode <http://lists.runrev.com/mailman/listinfo/use-livecode>> <http://lists.runrev.com/mailman/listinfo/use-livecode <http://lists.runrev.com/mailman/listinfo/use-livecode> <http://lists.runrev.com/mailman/listinfo/use-livecode <http://lists.runrev.com/mailman/listinfo/use-livecode>>>
>>> 
>>> 
>>> 
>>> Matthias Rebbe
>>> Bramkampsieke 13
>>> 32312 Lübbecke
>>> Tel	+49 5741 310000
>>>   	+49 160 5504462
>>> Fax: +49 5741 310002
>>> eMail: matthias at m-r-d.de <mailto:matthias at m-r-d.de> <mailto:matthias at m-r-d.de <mailto:matthias at m-r-d.de>> <mailto:matthias at m-r-d.de <mailto:matthias at m-r-d.de> <mailto:matthias at m-r-d.de <mailto:matthias at m-r-d.de>>>
>>> 
>>> BR5 Konverter - BR5 -> MP3 <http://matthiasrebbe.eu/portfolio/produkte/brx/ <http://matthiasrebbe.eu/portfolio/produkte/brx/> <http://matthiasrebbe.eu/portfolio/produkte/brx/ <http://matthiasrebbe.eu/portfolio/produkte/brx/>>>
>>> _______________________________________________
>>> use-livecode mailing list
>>> use-livecode at lists.runrev.com <mailto:use-livecode at lists.runrev.com> <mailto:use-livecode at lists.runrev.com <mailto:use-livecode at lists.runrev.com>>
>>> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
>>> http://lists.runrev.com/mailman/listinfo/use-livecode <http://lists.runrev.com/mailman/listinfo/use-livecode>
>> 
>> 
>> 
>> _______________________________________________
>> use-livecode mailing list
>> use-livecode at lists.runrev.com <mailto:use-livecode at lists.runrev.com> <mailto:use-livecode at lists.runrev.com <mailto:use-livecode at lists.runrev.com>>
>> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
>> http://lists.runrev.com/mailman/listinfo/use-livecode <http://lists.runrev.com/mailman/listinfo/use-livecode>
> 
> _______________________________________________
> use-livecode mailing list
> use-livecode at lists.runrev.com <mailto:use-livecode at lists.runrev.com>
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode




More information about the use-livecode mailing list