Bulk Video Upload XML fails in API

Hello All,

When i try bulk upload videos by XML on admin_console its working fine. But when i try it by PHP API it gives me below error

exception ‘KalturaClientException’ with message ‘failed creating formpost data’ in /Kaltura/KalturaClientBase.php:357\nStack trace:\n#0 /Kaltura/KalturaClient.php(4933): KalturaClientBase->doQueue()\n#1 \Kaltura/Media.php(278): KalturaMediaService->bulkUploadAdd(‘http://domain.c…’, Object(KalturaBulkUploadFilterJobData), NULL)…

Please find the using PHP API code:

    function bulkUpload($fileData = null){
        	$kClient  = $this->_kClient;
	$kConfig  = $this->_kConfig;
            $fileData = './bulk-upload-file/bulkUpload_1433408776.xml';
            $bulkUploadData = new KalturaBulkUploadFilterJobData();
            $bulkUploadEntryData = null;                
            $result = $kClient->media->bulkuploadadd($fileData, $bulkUploadData, $bulkUploadEntryData); }

Can you please help me guys?

Thanks in Advance

Hello,

See this example:

Thanks jess for your reply and help.

Still i am getting same problem like, can you please look into it and help me?

KalturaClientException Object
(
[message:protected] => failed creating formpost data
[string:Exception:private] =>
[code:protected] => -1
[file:protected] => /u1/opt/kaltura/apps/clipapp/v1.3/client/KalturaClientBase.php
[line:protected] => 199
[trace:Exception:private] => Array
(
[0] => Array
(
[file] => /u1/opt/kaltura/apps/clipapp/v1.3/client/KalturaClient.php
[line] => 1721
[function] => doQueue
[class] => KalturaClientBase
[type] => ->
[args] => Array
(
)
)

        [1] => Array
            (
                [file] => /u1/opt/kaltura/app/start/bulk-upload-csv.php
                [line] => 41
                [function] => add
                [class] => KalturaBulkUploadService
                [type] => ->
                [args] => Array
                    (
                        [0] => 8
                        [1] => * title,description,tags,url,contentType,category,scheduleStartDate,scheduleEndDate,thumbnailUrl,metadataProfileId,metadataField_AiredOn,metadataField_Location

Home,Homepage video with music,“Homepage, Creative”,http://sites.google.com/site/demokmc/Home/KalturaSiteAlt.flv,Video,category>subcategory1,2015-04-01T13:12:12,2015-06-01T13:12:12,image.com/thumb2.jpg,3,2015-04-01T13:12:12,"Location|,|Location2"
Companies to watch,Five companies to watch in 2009 report,“Kaltura, Press”,http://sites.google.com/site/demokmc/Home/VideoFishbowl-TheFiveOnlineVideoCompaniesToWatchIn2009612.flv,Video,category>subcategory2,2015-04-01T13:12:13,2015-06-01T13:12:13,http://image.com/thumb1.jpg,3,2015-04-01T13:12:13,"Location|,|Location3"
Creating together,Collaboration video,Collaboration,http://sites.google.com/site/demokmc/Home/spot.whats.mov,Video,category>subcategory3,2015-04-01T13:12:14,2015-06-01T13:12:14,3,2015-04-01T13:12:14,"Location|,|Location4"
Titanic in 5 Seconds,Titanic movie summarized in 5 seconds,“Titanic, Short”,http://sites.google.com/site/demokmc/Home/titanicin5seconds.flv,Video,category1>subcategory,2015-04-01T13:12:15,2015-06-01T13:12:15,3,2015-04-01T13:12:15,Location
Humor,Promotional funny video,“Humor, Promotional”,ftp://projects8:741@ftp.kaltura.com/kaltura final 4_CD.wmv,Video,category2>subcategory,2015-04-01T13:12:16,2015-06-01T13:12:16,3,2015-04-01T13:12:16,Location
Big Buck Bunny Trailer,A funny and furry 3D short about a giant rabbit who gets even with bullying rodents,“Big buck bunny, trailer”,ftp://projects8:741@ftp.kaltura.com/BigBuckBunnyTrailerHD.mov,Video,category3>subcategory,2015-04-01T13:12:17,2015-06-01T13:12:17,3,2015-04-01T13:12:17,“Location|,|Location1”

                        [2] => CSV
                        [3] => user.email@test.com
                    )
            )
    )

[previous:Exception:private] => 

)

I am using below code for upload bulk videos:-

$uploadedBy ="user.email@test.com";
$bulkUploadType = ‘CSV’;
$conversionProfileId = $kclient->conversionProfile->getDefault()->id;
$csvFileData = file_get_contents(‘bulkUploadXml.csv’);
try
{
$results = $kclient->bulkUpload->add($conversionProfileId, $csvFileData, $bulkUploadType, $uploadedBy);
if (isset($results)){
echo “Successfully uploaded”;
}else{
echo “Failed to upload :(”;
}
}
catch(Exception $e)
{
print_r($e);
}

Thanks in advance.

Hello,

What PHP version are you using? Also, are you working against our SaaS or a self hosted instance?
If self hosted, what version of server are you running and what PHP and also, look at the /opt/kaltura/log/kaltura_api_v3.log for errors when making the request.

Hello Jess,

I am using PHP 5.3.3 and using self hosted instance.
Also my server version CentOS 6.6.

I have tried to read log file. But not able to get anything from it.
Can you please let me know how can i solve that problem?

Thanks in advance.

Hello,

Please look at the log at /opt/kaltura/log/kaltura_api_v3.log and look for errors to better understand what in the flow goes wrong.