linlma
June 21, 2015, 5:03am
1
Hello Kaltura expert,
I am reading tutorials here, I think we need a session to talk to server and need a file which we are going to upload. Wondering what is the logical meaning of mediaEntry here in upload operation (it seems redundant, given we have session and file to upload) and what it is used for?
http://knowledge.kaltura.com/faq/create-new-kaltura-entry-and-upload-video-file-using-kaltura-api
thanks in advance,
Lin
jess
June 21, 2015, 8:15am
2
Hello Lin,
In order to upload a file, you indeed need to create an entry.
You might find this example easier to understand:
<?php
if (count($argv)<5){
echo 'Usage:' .__FILE__ .' <service_url> <partnerid> <secret> </path/to/asset>'."\n";
exit (1);
}
function upload($client,$fileData,$title,$conv_profile=null,$type=null)
{
try{
$uploadToken = new KalturaUploadToken();
$result = $client->uploadToken->add($uploadToken);
$tok=$result->id;
$resume = null;
$finalChunk = null;
$resumeAt = null;
$result = $client->uploadToken->upload($tok, $fileData, $resume, $finalChunk, $resumeAt);
$entry = new KalturaBaseEntry();
$entry->name = $title;
if (isset($conv_profile)){
$entry->conversionProfileId = $conv_profile;
This file has been truncated. show original
linlma
June 22, 2015, 8:08pm
3
Thanks Jess for the details, how upload physical file is bound to mediaEntry in your sample? Thanks.
BTW, I mean which line/lines combine them?
regards,
Lin