How can I upload a wave file using raw correctly?

So, I am using a content-type of “multipart/form-data; boundary=my_custom_boundary” in my header and have split my raw data as shown below:

Content-Disposition: form-data; name="path"

Content-Disposition: form-data; name="files"; filename="test3.wav"
Content-Type: audio/wave
Content-Transfer-Encoding: base64

[my base64 string of the file]


When sending a file via the form-data, I get this:


This is correct, and the code correctly identifies the file as a .wav and moves on

when sending the same file via the raw data in the code snippet above I get this:


The code fails as it cannot identify it as a wav file (no RIFF header and the content length is almost 50% larger)

The files are coming through to an API written in c# as a HttpPostedFileBase. I imagine I am doing something wrong with my raw upload, but as far as I’m aware I should be using base64, correct?

FYI, if I convert the base64 back to an audio file, it plays fine. So the base64 string itself is correct. I must upload the file using raw, I cannot use the form-data file upload for the testing I am doing.

edit: I used File to Base64 | Base64 Encode | Base64 Converter | Base64 to convert the file