Jelajahi Sumber

Merge pull request #37 from chamilo/1.9.x

Adding x-sendfile header see #6853
ycastillo 11 tahun lalu
induk
melakukan
461b0585e2
1 mengubah file dengan 5 tambahan dan 0 penghapusan
  1. 5 0
      main/inc/lib/document.lib.php

+ 5 - 0
main/inc/lib/document.lib.php

@@ -320,6 +320,11 @@ class DocumentManager
         if ($forced) {
             // Force the browser to save the file instead of opening it
 
+            global $_configuration;
+            if (!empty($_configuration['enable_x_sendfile_headers'])) {
+                header("X-Sendfile: $filename");
+            }
+
             header('Content-type: application/octet-stream');
             header('Content-length: ' . $len);
             if (preg_match("/MSIE 5.5/", $_SERVER['HTTP_USER_AGENT'])) {