opencart 从新服务器下载

opencart download from new server

实际上我想更改 opencart 下载路径到新网站,已经下载的文件夹是:

/system/download

config.php

define('DIR_DOWNLOAD', '/system/download/');

这是来自 controller/account/download.php

的代码
if ($download_info) {
    $file = DIR_DOWNLOAD . $download_info['filename'];
    $mask = basename($download_info['mask']);

    if (!headers_sent()) {
        if (file_exists($file)) {
            header('Content-Type: application/octet-stream');
            header('Content-Disposition: attachment; filename="' . ($mask ? $mask : basename($file)) . '"');
            header('Expires: 0');
            header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
            header('Pragma: public');
            header('Content-Length: ' . filesize($file));

            if (ob_get_level()) {
                ob_end_clean();
            }

            readfile($file, 'rb');

            exit();
        } else {
            exit('Error: Could not find file ' . $file . '!');
        }
    } else {
        exit('Error: Headers already sent out!');
    }
} else {
    $this->response->redirect($this->url->link('account/download', '', 'SSL'));
}

我想买一个新服务器只是为了下载,现在我想把opencart下载路径改到新服务器上。我该怎么做?

已经下载的系统是这样的:

https://example.com/index.php?route=account/download/download&download_id=16

它将从此目录中获取文件:

/system/download/example.zip

但我想从新服务器获取文件:

https://newserver.com/download/example.zip

可能吗?我更改了 DIR_DOWNLOAD 但没有成功。有什么想法吗?

是的,你可以,轻松进行:

$newserv = "http://newserver.com/";
$file = $newserv . $download_info['filename'];
$mask = basename($download_info['mask']);