Index: image_fupload.module =================================================================== RCS file: /cvs/drupal-contrib/contributions/modules/image_fupload/image_fupload.module,v retrieving revision 1.34 diff -u -r1.34 image_fupload.module --- image_fupload.module 9 Jun 2009 22:25:54 -0000 1.34 +++ image_fupload.module 19 Jul 2009 21:57:36 -0000 @@ -202,6 +202,26 @@ } else { // Get responsible error messages and send it to swfUpload + // Double check file error (copied and slightly modified from file_save_upload() in file.inc) + switch ($_FILES['files']['error']['image']) { + case UPLOAD_ERR_OK: + break; + + case UPLOAD_ERR_INI_SIZE: + case UPLOAD_ERR_FORM_SIZE: + form_set_error('image', 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())))); + break; + + case UPLOAD_ERR_PARTIAL: + case UPLOAD_ERR_NO_FILE: + form_set_error('image',t('The file %file could not be saved, because the upload did not complete.', array('%file' => $source))); + break; + + // Unknown error + default: + form_set_error('image',t('The file %file could not be saved. An unknown error has occurred.', array('%file' => $source))); + break; + } $messages = form_get_errors(); drupal_json(array('status' => FALSE, 'data' => t('Upload failed: !errors', array('!errors' => implode(' ', $messages))))); }