#361514 by Dave Reid and drewish: Use file name in file error messages.

merge-requests/26/head
Angie Byron 2009-01-21 02:07:10 +00:00
parent 4a99df11e9
commit 18e62bf8c5
1 changed files with 3 additions and 3 deletions

View File

@ -869,12 +869,12 @@ function file_save_upload($source, $validators = array(), $destination = FALSE,
switch ($_FILES['files']['error'][$source]) {
case UPLOAD_ERR_INI_SIZE:
case UPLOAD_ERR_FORM_SIZE:
drupal_set_message(t('The file %file could not be saved, because it exceeds %maxsize, the maximum allowed size for uploads.', array('%file' => $source, '%maxsize' => format_size(file_upload_max_size()))), 'error');
drupal_set_message(t('The file %file could not be saved, because it exceeds %maxsize, the maximum allowed size for uploads.', array('%file' => $_FILES['files']['name'][$source], '%maxsize' => format_size(file_upload_max_size()))), 'error');
return FALSE;
case UPLOAD_ERR_PARTIAL:
case UPLOAD_ERR_NO_FILE:
drupal_set_message(t('The file %file could not be saved, because the upload did not complete.', array('%file' => $source)), 'error');
drupal_set_message(t('The file %file could not be saved, because the upload did not complete.', array('%file' => $_FILES['files']['name'][$source])), 'error');
return FALSE;
case UPLOAD_ERR_OK:
@ -886,7 +886,7 @@ function file_save_upload($source, $validators = array(), $destination = FALSE,
// Unknown error
default:
drupal_set_message(t('The file %file could not be saved. An unknown error has occurred.', array('%file' => $source)), 'error');
drupal_set_message(t('The file %file could not be saved. An unknown error has occurred.', array('%file' => $_FILES['files']['name'][$source])), 'error');
return FALSE;
}