Answer the question
In order to leave comments, you need to log in
How to change the link to download a file?
An infoblock with elements that have the "File" property is given. Files are saved in /upload/ .
You need to add an additional directory /download/ to the link to the file . Thus, the link to the file in the element card in the admin should become: "/download/upload/file.txt" .
How to do it? Use PHPQuery or is there a less hacky way?
It's about this link:
Below is the reason for this question.
It was necessary to restrict unauthorized users from downloading from /upload/. I used the script offered by Bitrix for controlled download and placed it along the path: "/download/download_private.php". Set it up to download files from /upload/.
Links to files from the infoblock element now, of course, respond with 403. And it is impossible to download a file from the admin panel without adding /download/ to the link.
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question