M
M
Mikhail Frolov2021-08-07 10:44:57
PHP
Mikhail Frolov, 2021-08-07 10:44:57

How to give a file from a third-party resource without burning the source?

There is a third party resource like " https://files.com/download.php?id=1202 ". When you switch to it, the download of the file starts.
And there is my site " https://site.ru " on which I want to give the client a file with " https://files/download.php?id=1202 " without burning a third-party resource.
Is it possible to somehow give a file from a third-party resource without saving a copy of it to the server?
Is it possible somehow when downloading a remote file to immediately transfer it to the client in the browser, so that he thinks that he is downloading the file from the site " https://site.ru "?
In short, how to become an intermediary between a client and a remote host to download a file?.
I would be happy with an example in php or python.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Sergey Sokolov, 2021-08-07
@neuralink7232050

In order not to disclose the source, the return of the file must come from your IP.
You can configure this on the web server so as not to load the server with PHP / Python work during the download.
Google about NGINX proxies as an option. The proxy_pass instruction
As a result, your site will redirect the visitor to a link on itself, https://site.ru/download/1202and the web server will return a file from that secret site with id to this request 1202.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question