Created this based on doc comments: http://api.drupal.org/api/drupal/includes%21file.inc/function/file_validate_extensions/7 My upload field definition:
$form['xml'] = array(
#'#title' => t('Upload Document XML'),
'#type' => 'file',
'#description' => t('We process only XML files'),
'#upload_location' => "public://documents/",
"#upload_validators" => array("file_validate_extensions" => array("xml")),
);
But every file type passed in...
Any suggestions, please?
Am I doing it wrong or I should call file_validate_extensions directly inside validation function
file_validate_extensions()
should be "A string with a space separated list of allowed extensions.