Upload file using Kaltura JS API

Hello -

I’m trying to upload a file and create an entry using the Kaltura JS API.

However, I keep getting a “Missing parameter “fileData”” error when calling media.upload, and I’m not sure about the correct format.

The form has a field as follows:

<input type="file" name="fileData">

And the upload code is:

var formData = new FormData(form);

client.media.upload(function(success, results) {
    if (!success || (results && results.code && results.message)) {
        console.log('Kaltura Error', success, results);
    } else {
        console.log('Kaltura Result', results);
    }
}, formData);

Any ideas on what might be wrong?

Thanks.

Please take a look at https://developer.kaltura.com/recipes/upload#/start

1 Like

Thank you, @jess! :slight_smile: