[英]opencart download from new server
實際上我想將opencart
下載口更改為新網站,已經下載的文件夾為:
/ system /下載
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
但我想從新服務器獲取文件:
可能嗎? 我更改了DIR_DOWNLOAD
但沒有成功。 任何想法?
是的,您可以輕松進行以下操作:
$newserv = "http://newserver.com/";
$file = $newserv . $download_info['filename'];
$mask = basename($download_info['mask']);
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.