Copyright © 2012 Kaltura Inc.
All Rights Reserved. Designated trademarks and brands are the property of their respective owners.
Use of this web site constitutes acceptance of the Terms of Use and Privacy Policy.
EduVideo.org
It isn't a string, as some posts suggest. It is an object which should support toParams(), which makes it a base object, but what does upload($fileData) expect. exactly?
There is text instead of html where fileData appears in the online docs so there is no link to the data structure and although there are some comments posted, there is no explanation.
The documentation that exists:
name type Description
fileData file The file data
Type 'file' in PHP suggests I do an fopen and pass the handle, which isn't correct. The file location isn't correct. What does it want?
The exact error:
PHP Fatal error: Call to a member function toParams() on a non-object
I never did get upload() working correctly, so I resorted to uploading the file to a directory on the server, then calling addFromUrl(). That works fine.
There is a bug in kFile.class.php in the server code. In debugging, I discovered kLog::log("curl_exec failed [$entry_url]"); uses the uninitialized $entry_url instead of $sourceUrl, which is initialized.
After a few hours digging though code...
There is a requirement to use $_FILES. Bad code. No biscuit.
I create a KalturaMediaObject with a $kme->name of my file and what happens in the process in-between? By the time it gets to the deserializer the "name" is "fileData" and the type is magically set to "file." The confusion is that it then uses $_FILES['fileData'] (actually $_FILES[$name] after $name is set to 'fileData'). Specifically, complete with comment:
"if (isset($_FILES[$name])) // FIXME: KalturaRequestDeserializer doesn't depend on $_POST or $_GET, so its a not a good idea to access $_FILES here"
You're right about that. Hope this helps someone. Onward.