R
R
ragnar_ok2020-04-24 16:54:00
1C-Bitrix
ragnar_ok, 2020-04-24 16:54:00

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:
5ea2f23c068bf533729300.png

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

1 answer(s)
A
Aisamiery, 2020-04-24
@ragnar_ok

you can choose where to upload files, there are different buttons on the right. And you can restrict the folder by rights using the regular Bitrix mechanism https://dev.1c-bitrix.ru/learning/course/index.php...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question