while ($file = readdir($h2)) {
            if ($file == '.' || $file == '..') {
                continue;
            }
            @unlink($dir . $subdir . '/' . $file);
        }
        closedir($h2);
        @rmdir($dir . $subdir);
    }
    closedir($h1);
}
// Now send the file with header() magic
header("Expires: Mon, 26 Nov 1962 00:00:00 GMT");
header("Last-Modified: " . gmdate("D,d M Y H:i:s") . " GMT");
header("Cache-Control: no-cache, must-revalidate");
header("Pragma: no-cache");
header("Content-Type: Application/octet-stream");
header("Content-disposition: attachment; filename=" . $downloads['orders_products_filename']);
if (DOWNLOAD_BY_REDIRECT == 'true') {
    // This will work only on Unix/Linux hosts
    tep_unlink_temp_dir('pub/');
    $tempdir = tep_random_name();
    umask(00);
    mkdir('pub/' . $tempdir, 0777);
    symlink(DIR_FS_DOWNLOAD . $downloads['orders_products_filename'], 'pub/' . $tempdir . '/' . $downloads['orders_products_filename']);
    if (file_exists('pub/' . $tempdir . '/' . $downloads['orders_products_filename'])) {
        tep_redirect(tep_href_link('pub/' . $tempdir . '/' . $downloads['orders_products_filename']));
    }
}
// Fallback to readfile() delivery method. This will work on all systems, but will need considerable resources
readfile(DIR_FS_DOWNLOAD . $downloads['orders_products_filename']);
        while ($file = readdir($h2)) {
            if ($file == '.' || $file == '..') {
                continue;
            }
            @unlink($dir . $subdir . '/' . $file);
        }
        closedir($h2);
        @rmdir($dir . $subdir);
    }
    closedir($h1);
}
// Now send the file with header() magic
header("Expires: Mon, 26 Nov 1962 00:00:00 GMT");
header("Last-Modified: " . gmdate("D,d M Y H:i:s") . " GMT");
header("Cache-Control: no-cache, must-revalidate");
header("Pragma: no-cache");
header("Content-Type: Application/octet-stream");
header("Content-disposition: attachment; filename=" . $downloads['orders_products_filename']);
if (DOWNLOAD_BY_REDIRECT == 'true') {
    // This will work only on Unix/Linux hosts
    tep_unlink_temp_dir(DIR_FS_DOWNLOAD_PUBLIC);
    $tempdir = tep_random_name();
    umask(00);
    mkdir(DIR_FS_DOWNLOAD_PUBLIC . $tempdir, 0777);
    symlink(DIR_FS_DOWNLOAD . $downloads['orders_products_filename'], DIR_FS_DOWNLOAD_PUBLIC . $tempdir . '/' . $downloads['orders_products_filename']);
    if (file_exists(DIR_FS_DOWNLOAD_PUBLIC . $tempdir . '/' . $downloads['orders_products_filename'])) {
        tep_redirect(tep_href_link(DIR_WS_DOWNLOAD_PUBLIC . $tempdir . '/' . $downloads['orders_products_filename']));
    }
}
// Fallback to readfile() delivery method. This will work on all systems, but will need considerable resources
readfile(DIR_FS_DOWNLOAD . $downloads['orders_products_filename']);
Пример #3
0
        while ($file = readdir($h2)) {
            if ($file == '.' || $file == '..') {
                continue;
            }
            @unlink($dir . $subdir . '/' . $file);
        }
        closedir($h2);
        @rmdir($dir . $subdir);
    }
    closedir($h1);
}
// Now send the file with header() magic
header("Expires: Mon, 26 Nov 1962 00:00:00 GMT");
header("Last-Modified: " . gmdate("D,d M Y H:i:s") . " GMT");
header("Cache-Control: no-cache, must-revalidate");
header("Pragma: no-cache");
header("Content-Type: Application/octet-stream");
header("Content-disposition: attachment; filename=" . $Qdownload->value('orders_products_filename'));
if (DOWNLOAD_BY_REDIRECT == 'true') {
    // This will work only on Unix/Linux hosts
    tep_unlink_temp_dir(OSCOM::getConfig('dir_root') . 'pub/');
    $tempdir = tep_random_name();
    umask(00);
    mkdir(OSCOM::getConfig('dir_root') . 'pub/' . $tempdir, 0777);
    symlink(OSCOM::getConfig('dir_root') . 'download/' . $Qdownload->value('orders_products_filename'), OSCOM::getConfig('dir_root', 'Shop') . 'pub/' . $tempdir . '/' . $Qdownload->value('orders_products_filename'));
    if (is_file(OSCOM::getConfig('dir_root') . 'pub/' . $tempdir . '/' . $Qdownload->value('orders_products_filename'))) {
        OSCOM::redirect('pub/' . $tempdir . '/' . $Qdownload->value('orders_products_filename'));
    }
}
// Fallback to readfile() delivery method. This will work on all systems, but will need considerable resources
readfile(OSCOM::getConfig('dir_root') . 'download/' . $Qdownload->value('orders_products_filename'));