This code i wrote does work and downloads file to client browser but with a delay, because it first downloads file to a some kind of temp directory maybe and then when thats done it just passes it to client. I don't want this i want file to be downloaded without any delay.
header('Content-Type: application/force-download');
header('Content-Disposition: attachment; filename="'.$filename.'"');
header('Content-Length: '.filesize');
$chdownload = curl_init();
curl_setopt($ch, CURLOPT_URL, $url]);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$data = curl_exec($ch);
curl_close($ch);
echo $data;