Changeset 1560 for trunk/action.php
- Timestamp:
- Oct 10, 2006, 11:23:06 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/action.php
r1552 r1560 26 26 // +-----------------------------------------------------------------------+ 27 27 28 define('PHPWG_ROOT_PATH','./'); 29 include_once(PHPWG_ROOT_PATH.'include/common.inc.php'); 30 31 // Check Access and exit when user status is not ok 32 check_status(ACCESS_GUEST); 33 28 34 function force_download ($filename) 29 35 { 30 36 //TODO : messages in "lang" 31 $filename = realpath($filename); 37 if (!url_is_remote($filename)) 38 { 39 $filename = realpath($filename); 40 if (!file_exists($filename)) 41 { 42 die("NO FILE HERE"); 43 } 44 $file_size = @filesize($filename); 45 } 46 else 47 { 48 $file_size = 0; 49 } 32 50 33 51 $file_extension = strtolower(substr(strrchr($filename,"."),1)); … … 46 64 } 47 65 48 if (!file_exists($filename)) {49 die("NO FILE HERE");50 }51 52 66 header("Pragma: public"); 53 67 header("Expires: 0"); … … 58 72 .basename($filename)."\";"); 59 73 header("Content-Transfer-Encoding: binary"); 60 header("Content-Length: ".@filesize($filename)); 74 if (isset($file_size) and ($file_size != 0)) 75 { 76 header("Content-Length: ".@filesize($filename)); 77 } 61 78 62 79 // Looking at the safe_mode configuration for execution time
Note: See TracChangeset
for help on using the changeset viewer.