Reputation: 16615
Actually i want to change opencart
download routh to new website, already download folder is:
/system/download
config.php
define('DIR_DOWNLOAD', '/system/download/');
and here is code from 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'));
}
i want to buy a new server just for downloading, and now i want change opencart download route to new server. how can i do this?
Already download system is like this:
https://example.com/index.php?route=account/download/download&download_id=16
and it will get file from this directory:
/system/download/example.zip
but i want to get file from new server:
Is it possible? I changed DIR_DOWNLOAD
but no success. Any idea?
Upvotes: 0
Views: 180
Reputation:
Yes you can, go with this easily:
$newserv = "http://newserver.com/";
$file = $newserv . $download_info['filename'];
$mask = basename($download_info['mask']);
Upvotes: 1