L
L
Lorem Ipsum2021-01-12 08:54:03
PHP
Lorem Ipsum, 2021-01-12 08:54:03

How can you protect an XML file from being opened by anyone?

I made an XML file parser for 1C, but the generated XML is in the public domain, anyone who knows the link can access the file, but how to restrict access so that it can only be opened with a password?
I write in PHP.

Answer the question

In order to leave comments, you need to log in

3 answer(s)
A
Anton R., 2021-01-12
@anton_reut

Prohibit access directly to htaccess, but only through a script, and then what is enough imagination.

F
FanatPHP, 2021-01-12
@FanatPHP

Do not put the file in the public domain.
Send with a script that takes a file name in the parameter, checks authorization and gives the file with the appropriate headings
"how to give the XML file generated by the PHP script" in Google you can find a little more than a dofig of examples

X
xmoonlight, 2021-01-12
@xmoonlight

Proxy file upload (download) via php code.
Nginx or Apache - it doesn't matter what is used at all: the main thing is to correctly configure the central handler of the necessary requests in the config.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question