Goddamn! After searching google and stackoverflow and chatgpt, I finally figured it out. I was using FormData and it seems that it is only multipart capable. So when upload a file using the FormData, I was always adding the boundary header information.
The solution was to send the file as binary. This would then be saved through webdav and everything is perfect!
The solution ultimately came from chatgpt :)
I will say it isn’t as helpful as I had originally hoped it would be. It gave me some very wrong and not working answers most of the time.
I very much could have figured out that I needed to get rid of the FormData and just send the file over directly by googling and understanding what was going on.
However being able to talk to the duck and get responses let me go down all sorts of paths and it definitely helped.
Writing it out may have also helped.
Chatgpt is something.