P
P
pixal2016-10-20 12:20:32
PHP
pixal, 2016-10-20 12:20:32

How to upload and redirect a file to php?

I am writing my own streaming server in php based on the mail.ru cloud. I get the contents of the folder, I get a link to download the file, everything works fine. But here the link is tied to ip, and since php is a server language, it gives out the ip of the server. Please tell me how to implement it so that the server downloads the file and then issues it with a redirect. So that the player can correctly open the file via the link. Any ideas?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Anton fon Faust, 2016-10-23
@bubandos

What does a redirect have to do with it, in general, if you want to send from your server?
We're talking about proxies here.
Accordingly, either downloading the file (here it will be necessary to implement a queue, background downloading and feedback for the page from which the download was requested), then issuing it from your server and deleting it, or writing an http proxy in php, or (which, in my opinion, much easier) setting up nginx to proxy requests to your server from which the file is being returned.
Just file_get_contents will be delivered to you very quickly by the server, because with large files, you will start to run out of memory and execute_time, and with a large number of download requests, you will run into a lack of resources even faster.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question