Javascript API uploading

How do I send the File data via JS to Kaltura. I have used the upload function but it keeps saying I’m missing a required parameter for the File data. I’m sending it as a bufferArray via the FileReader class in js. Am I going about it the wrong way?

please try this with kaltura api

What should fileData be set equal to if you’re using a html file input field? I tried setting it to the base 64 encoded version of the file, but I keep getting a Missing parameter "fileData" error.