Encoding Arrays with File Paths

Bob Sneidar bobsneidar at iotecdigital.com
Wed Feb 19 20:17:49 EST 2025


I have narrowed down the issue to the fact that the array I am trying to arrayDecode has a lot of data in the [n] [“data”] key. Without that data, the array decodes file. With it I get an error. I even tried base64encoding it first before putting it in the array key, but that does not seem to help. I may be running up on some kind of limit to array keys. Small UTF8 text files transfer no problem. Large binary files, BIG problem. (And yes I am using open file <filename> for binary read.) 

If I do not put the data in an array key, but rather send the data by itself, then it decrypts successfully on the other end, so I think what I am going to have to do is send the array first without file data, then recursively send each file after encrypting and base64encoding. 

Oh well. Lessons learned. 

Bob S


> On Feb 19, 2025, at 8:01 AM, Bob Sneidar via use-livecode <use-livecode at lists.runrev.com> wrote:
> 
> Hi Monte. I did try your versioning solution but I am still having issues on the receiving end. Given your understanding of what I am trying to do here, how would you “package” the data so that it can be sent over the wire (socket communications)? The idea is to send an array with different key value pairs, but the file data needs to be encrypted for security. 
> 
> I’m not sure I should even be using base64encoding. There is something in the arrayEncode dictionary entry that says I should be using URLEncode before sending data over the wire. I tried that but the receiving end got an empty string. <sigh>
> 
> Bob S
> 
> 
>> On Feb 18, 2025, at 3:29 PM, Monte Goulding via use-livecode <use-livecode at lists.runrev.com> wrote:
>> 
>> Ah ok so just checked the docs on the array encode version added in LC 7 and found:
>> ```
>> If present, and >= "7.0" then the array is encoded in such a way as to preserve unicode in keys and values, as well as NUL chars in keys and values
>> ```
>> 
>> So try `arrayEncode(array, “7.0")`
>> 



More information about the use-livecode mailing list