Hello Luuk,
Do not use the base64 string. When you send the file contents as is, it should work.
Headers -
1. Content-Type : 'application/octet-stream'
2. Content-Range : 'bytes 0-{content byte}' (you will need to calculate the content range)
In the Request, pass the file as - "$FileDocument/Contents"
Hope this helps.
Regards,
Niraj