Browse Source

Merge pull request #37 from chamilo/1.9.x

Adding x-sendfile header see #6853
ycastillo 11 years ago
parent
commit
461b0585e2
1 changed files with 5 additions and 0 deletions
  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) {
         if ($forced) {
             // Force the browser to save the file instead of opening it
             // 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-type: application/octet-stream');
             header('Content-length: ' . $len);
             header('Content-length: ' . $len);
             if (preg_match("/MSIE 5.5/", $_SERVER['HTTP_USER_AGENT'])) {
             if (preg_match("/MSIE 5.5/", $_SERVER['HTTP_USER_AGENT'])) {