How to make a link to the file downloads?

There is a directory on OpenCart 3.x, I want the cap to insert a link like:
<a href="/price.xls">Price list</a>

And in the admin anywhere to upload a file that is just yet be converted and be on your way /price.xls (or in any subfolder). Saw also provides built-in "Download", but file is attached to the product and only after the "shopping" available to download etc but I have a catalogue (without cart, orders, etc.) so necessary as to give the opportunity to download the price list.

PS> the pricelist is generated not from the directory and loaded manually (third price, different from what is on the website)
March 19th 20 at 09:12
1 answer
March 19th 20 at 09:14
Solution
You can't use Load for the purpose. Remove the generation of the token in the file name admin/controller/catalog/download.php
$file = $filename . '.' . token(32);
Replace
$file = $filename;

The file is in system/storage/download/{file name}
all would be nothing, just a little rigged, the file is uploaded (changed the directory because the storage made for the aisles of the root folder), but when referring to the file in the address bar, get

Forbidden
You don't have permission to access /system/storage/download/price.xlsx on this server.


PS> for all folders in the path are 777 rights.
P. S. S.> I need this file available on the download link
<a href="path to file">Price list</a> - Antonetta.Auer commented on March 19th 20 at 09:17
It is necessary to make a downloads folder under system config:
define('DIR_DOWNLOAD', '{path to site root}/download/');

The file will be in /download/{file name} - Lincoln.Macejkov commented on March 19th 20 at 09:20
@Lincoln.Macejkovin the file download.php
move_uploaded_file($this->request->files['file']['tmp_name'], '/var/www/user/data/www/site/download/' . $file);

did the path to the folder boot and the file is now available адресу/download/price.xlsx

Thank you very much. Like understood. - Antonetta.Auer commented on March 19th 20 at 09:23

Find more questions by tags OpenCart