Hi guys,

I spent days on this problem and no one seems to have a solution.
I want to communicate with a WebService via SOAP. This WebService got a function to send and receive files, which are encoded in Base64. I found a lot of implementations of the Base64 encoder/decoder - for example this one: http://www.webtoolkit.info/javascript-base64.html
Adobe Air uses WebKit so there are also the functions atob and btoa available.

The Base64 thing should work. Now the reading of the files... I want to read any type of file - I think this function should work:
    this.readFile = function(inputfile){
        var file = new air.File(inputfile);
        var bytes = new air.ByteArray();
        if (file.exists) {
            var stream = new air.FileStream();
            stream.open(file, air.FileMode.READ);
            bytes.endian = air.Endian.LITTLE_ENDIAN;
            stream.readBytes(bytes, 0, file.size);
        return bytes;
I create the Base64 string like this:
var binary = c_FileManager.readFile('Stunden.xlsx');
The created string is not correct. It almost looks right, but some Bytes seem to be interpreted not correct.

This is how it should look:
This is what I get:
I think the problem is how I read the files or how I use the Base64 encoder with the ByteArray type.

I don't know how I can solve the problem