diff --git a/core/modules/file/file.install b/core/modules/file/file.install
index 7ce65bb..218e260 100644
--- a/core/modules/file/file.install
+++ b/core/modules/file/file.install
@@ -197,8 +197,9 @@ function file_requirements($phase) {
   // Check the server's ability to indicate upload progress.
   if ($phase == 'runtime') {
     $implementation = file_progress_implementation();
-    $apache = strpos($_SERVER['SERVER_SOFTWARE'], 'Apache') !== FALSE;
-    $fastcgi = strpos($_SERVER['SERVER_SOFTWARE'], 'mod_fastcgi') !== FALSE || strpos($_SERVER["SERVER_SOFTWARE"], 'mod_fcgi') !== FALSE;
+    $server_software = Drupal::request()->server->get('SERVER_SOFTWARE');
+    $apache = strpos($server_software, 'Apache') !== FALSE;
+    $fastcgi = strpos($server_software, 'mod_fastcgi') !== FALSE || strpos($server_software, 'mod_fcgi') !== FALSE;
     $description = NULL;
     if (!$apache) {
       $value = t('Not enabled');
diff --git a/core/modules/file/file.module b/core/modules/file/file.module
index 65b15e5..87969b9 100644
--- a/core/modules/file/file.module
+++ b/core/modules/file/file.module
@@ -737,7 +737,8 @@ function file_ajax_upload() {
   $form_parents = func_get_args();
   $form_build_id = (string) array_pop($form_parents);
 
-  if (empty($_POST['form_build_id']) || $form_build_id != $_POST['form_build_id']) {
+  $request = \Drupal::request();
+  if (!$request->request->has('form_build_id') || $form_build_id != $request->request->get('form_build_id')) {
     // Invalid request.
     drupal_set_message(t('An unrecoverable error occurred. The uploaded file likely exceeded the maximum file size (@size) that this server supports.', array('@size' => format_size(file_upload_max_size()))), 'error');
     $response = new AjaxResponse();
