php - Every requests should contain a server IP -


i have file hosted on external web service - url: http://external-service.com/file.flv

this file can download ip of web service. every visitor should can download file how while every visitor has other ip address ip of server?

i use curl request curl going server, not visitor. can't use:

echo $response_from_curl; 

because file large. server has max_execution_file - 450 seconds. it's not enough.

i use:

header("location: http://external-service.com/file.flv"); 

but in example, file can't downlaod because redirect visitor ip it's bad idea too.

can hide real user ip in example , make request user browser using server ip?

maybe know how can solve problem.

thanks.

your server has download file , show user correct headers.

little example:

<?php header("content-type: video/flv"); $file_url = "http://external-service.com/file.flv"; echo file_get_contents($file_url); ?> 

i recommend use curl.

example curl:

<?php     header("content-type: video/flv");     $file_url = "http://external-service.com/file.flv";     $ch = curl_init();     $timeout = 0;     curl_setopt ($ch, curlopt_url, $file_url);     curl_setopt ($ch, curlopt_connecttimeout, $timeout);     curl_exec($ch);     curl_close($ch); ?> 

Comments

Popular posts from this blog

google chrome - Developer tools - How to inspect the elements which are added momentarily (by JQuery)? -

angularjs - Showing an empty as first option in select tag -

php - Cloud9 cloud IDE and CakePHP -