Uploading kml/kmz files using the GraphQL API

Sup folks!

I’m working on an integration with Monday to upload some files, my main problem is with KML/KMZ extensions.

I’ve manged to upload pdf and csv without any issues, but these guys are having an odd behaviour. When I send one of those to the files column in my board, it sits there as a *.kmz file, however if I download it, the downloaded file has the extension converted to xml.
I understand this is not a browser issue, because the very same file doesn’t have this problem if I upload it by hand to the Monday board, the issue has only being happening when the file is sent through the API.

One of my references for research is the link below, I’ve followed most of the recommendations, including change the “Content-Type” field to either “application/vnd.google-earth.kmz” or " application/vnd.google-earth.kml/xml", with the same effect.

I understand this can be kind of esoteric, but I suppose it has some relation to how the multi-part form is being built. Below is an example of how I’ve been doing it.

        let data="";
        data += "--" + boundary + "\r\n";
        data += "Content-Disposition: form-data; name=\"query\"; \r\n";
        data += "Content-Type:application/json\r\n\r\n";
        data += "\r\n" + query + "\r\n";

        data += "--" + boundary + "\r\n";
        data += "Content-Disposition: form-data; name=\"map\"; \r\n";
        data += "Content-Type:application/json\r\n\r\n";
        data += "\r\n" + JSON.stringify(map)+ "\r\n";

        data += "--" + boundary + "\r\n";
        data += "Content-Disposition: form-data; name=\"file\"; filename=\"" + filename + "\"\r\n";
        data += "Content-Type:application/vnd.google-earth.kmz\r\n\r\n";
        const payload = Buffer.concat([
                Buffer.from(data, "utf8"),
                new Buffer.from(content, 'binary'),
                Buffer.from("\r\n--" + boundary + "--\r\n", "utf8"),

        return payload;

Any help or tip is appreciated.