This would have easily been solved with the FormData() object: https://javascript.info/formdata
Anyone managed to fix this in SM9.72 version? I know it's easy to use base64Encoding, but tools like Jira doesn't like this encoding. Currently we have a workaround letting 'curl' handle the attachment transfer but it is as I say just a workaround.