  |
5 | 5 | | osCommerce, Open Source E-Commerce Solutions |
| |
6 | 6 | | http://www.oscommerce.com |
| |
7 | 7 | | |
  |
8 | | - | Copyright (c) 2003 osCommerce |
| |
| 8 | + | Copyright (c) 2007 osCommerce |
|
9 | 9 | | |
| |
10 | 10 | | Released under the GNU General Public License |
| |
11 | 11 | | */ |
| |
|
|
 |
… |
|
90 | 90 | | umask(0000); |
| |
91 | 91 | | mkdir(DIR_FS_DOWNLOAD_PUBLIC . $tempdir, 0777); |
| |
92 | 92 | | symlink(DIR_FS_DOWNLOAD . $downloads['orders_products_filename'], DIR_FS_DOWNLOAD_PUBLIC . $tempdir . '/' . $downloads['orders_products_filename']); |
  |
93 | | - | tep_redirect(DIR_WS_DOWNLOAD_PUBLIC . $tempdir . '/' . $downloads['orders_products_filename']); |
| |
94 | | - | } else { |
| |
95 | | - | // This will work on all systems, but will need considerable resources |
| |
96 | | - | // We could also loop with fread($fp, 4096) to save memory |
| |
97 | | - | readfile(DIR_FS_DOWNLOAD . $downloads['orders_products_filename']); |
| |
| 93 | + | if (file_exists(DIR_FS_DOWNLOAD_PUBLIC . $tempdir . '/' . $downloads['orders_products_filename'])) { |
| |
| 94 | + | tep_redirect(tep_href_link(DIR_WS_DOWNLOAD_PUBLIC . $tempdir . '/' . $downloads['orders_products_filename'])); |
| |
| 95 | + | } |
|
98 | 96 | | } |
  |
| 97 | + | |
| |
| 98 | + | // Fallback to readfile() delivery method. This will work on all systems, but will need considerable resources |
| |
| 99 | + | readfile(DIR_FS_DOWNLOAD . $downloads['orders_products_filename']); |
  |
99 | 100 | | ?> |