title: opencart download from new server
body: <p>Actually i want to change <code>opencart</code> download routh to new website, already download folder is:</p>
  
  <blockquote>
    <p>/system/download</p>
  </blockquote>
  
  <p><strong>config.php</strong></p>
  
  <pre><code>define('DIR_DOWNLOAD', '/system/download/');
  </code></pre>
  
  <p>and here is code from <code>controller/account/download.php</code></p>
  
  <pre><code>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-&gt;response-&gt;redirect($this-&gt;url-&gt;link('account/download', '', 'SSL'));
  }
  </code></pre>
  
  <p>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?</p>
  
  <p>Already download system is like this:</p>
  
  <blockquote>
    <p><a href="https://example.com/index.php?route=account/download/download&amp;download_id=16" rel="nofollow noreferrer">https://example.com/index.php?route=account/download/download&amp;download_id=16</a></p>
  </blockquote>
  
  <p>and it will get file from this directory:</p>
  
  <blockquote>
    <p>/system/download/example.zip</p>
  </blockquote>
  
  <p>but i want to get file from new server:</p>
  
  <blockquote>
    <p><a href="https://newserver.com/download/example.zip" rel="nofollow noreferrer">https://newserver.com/download/example.zip</a></p>
  </blockquote>
  
  <p>Is it possible? I changed <code>DIR_DOWNLOAD</code> but no success. Any idea?</p>