diff --git a/core/modules/file/file.module b/core/modules/file/file.module
index 596a860ebe..7caabd3fa9 100644
--- a/core/modules/file/file.module
+++ b/core/modules/file/file.module
@@ -915,6 +915,7 @@ function _file_save_upload_single(\SplFileInfo $file_info, $form_field_name, $va
   // Check for file upload errors and return FALSE for this file if a lower
   // level system error occurred. For a complete list of errors:
   // See http://php.net/manual/features.file-upload.errors.php.
+  $error_to_log = NULL;
   switch ($file_info->getError()) {
     case UPLOAD_ERR_INI_SIZE:
     case UPLOAD_ERR_FORM_SIZE:
@@ -926,6 +927,18 @@ function _file_save_upload_single(\SplFileInfo $file_info, $form_field_name, $va
       \Drupal::messenger()->addError(t('The file %file could not be saved because the upload did not complete.', ['%file' => $original_file_name]));
       return FALSE;
 
+    case UPLOAD_ERR_NO_TMP_DIR:
+      $error_to_log = t('The file %file could not be saved because the server is missing a temporary folder.', ['%file' => $file_info->getFilename()]);
+      break;
+
+    case UPLOAD_ERR_CANT_WRITE:
+      $error_to_log = t('The file %file could not be saved because the server is unable to write to disk.', ['%file' => $file_info->getFilename()]);
+      break;
+
+    case UPLOAD_ERR_EXTENSION:
+      $error_to_log = t('The file %file could not be saved because a PHP extension stopped the file upload. PHP does not provide a way to ascertain which extension caused the file upload to stop; examining the list of loaded extensions with phpinfo() may help.', ['%file' => $file_info->getFilename()]);
+      break;
+
     case UPLOAD_ERR_OK:
       // Final check that this is a valid upload, if it isn't, use the
       // default error handler.
@@ -935,11 +948,23 @@ function _file_save_upload_single(\SplFileInfo $file_info, $form_field_name, $va
 
     default:
       // Unknown error
-      \Drupal::messenger()->addError(t('The file %file could not be saved. An unknown error has occurred.', ['%file' => $original_file_name]));
-      return FALSE;
-
+      $error_to_log = t('The file %file could not be saved. An unknown error has occurred.', array('%file' => $file_info->getFilename()));
+      break;
+  }
+  if (isset($error_to_log)) {
+    // Use trigger_error() here so that the error will be reported to the
+    // screen depending on the site's error reporting level.
+    trigger_error($error_to_log, E_USER_ERROR);
+    // Uncongditionally display a error message to the end user. This is a
+    // generic message since the errors that trigger this represent
+    // server-level problems that end users should not know about (and cannot
+    // fix by attempting the upload again).
+    \Drupal::messenger()->addError(t('The file %file could not be saved. An unknown error has occurred.', ['%file' => $original_file_name]));
+    $files[$i] = FALSE;
+    // Begin building file entity.
+    continue;
   }
-  // Begin building file entity.
+
   $values = [
     'uid' => $user->id(),
     'status' => 0,
