You are here

function kaltura_uploader_validate_file in Kaltura 7.3

Upload validator: Checks that the file type is allowed by Kaltura.

Parameters

object $file: A Drupal file object.

Return value

string[] An array. If the file is not allowed, it will contain an error message.

File

./kaltura_upload.inc, line 82
Kaltura media upload functions.

Code

function kaltura_uploader_validate_file($file) {
  $errors = array();
  if (!kaltura_get_media_type_by_mime($file->filemime)) {
    $errors[] = t('Only images, audio and video files are allowed.');
  }
  return $errors;
}