Php 从新服务器下载opencart
实际上我想将opencart下载routh更改为新网站,已经下载的文件夹是: /系统/下载 config.php 下面是controller/account/download.php中的代码 我想买一个新的服务器只是为了下载,现在我想改变opencart下载路线到新的服务器。我该怎么做 已经下载的系统如下所示: 它将从以下目录中获取文件: /system/download/example.zip 但我想从新服务器获取文件:Php 从新服务器下载opencart,php,opencart,opencart2.x,opencart2.3,Php,Opencart,Opencart2.x,Opencart2.3,实际上我想将opencart下载routh更改为新网站,已经下载的文件夹是: /系统/下载 config.php 下面是controller/account/download.php中的代码 我想买一个新的服务器只是为了下载,现在我想改变opencart下载路线到新的服务器。我该怎么做 已经下载的系统如下所示: 它将从以下目录中获取文件: /system/download/example.zip 但我想从新服务器获取文件: 可能吗?我更改了DIR_下载,但没有成功。有什么想法吗?是的,你可以很容
可能吗?我更改了DIR_下载,但没有成功。有什么想法吗?是的,你可以很容易地做到:
$newserv = "http://newserver.com/";
$file = $newserv . $download_info['filename'];
$mask = basename($download_info['mask']);
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'));
}
$newserv = "http://newserver.com/";
$file = $newserv . $download_info['filename'];
$mask = basename($download_info['mask']);