my provider doesn't allow fopen(). So I used curl instead of this to download files. But this only works for smaller files (<100mb) because of server timout and memory limits. And I need to download large files (1gb).
Is there another way to download large files?
Here is my code:
$file = $_GET['dateiUrl'];
//set header
header("Cache-Control: public");
header("Content-Description: File Transfer");
header('Content-Type: application/force-download');
header("Content-Transfer-Encoding: binary");
header("Content-Disposition: attachment; filename=" . basename($file));
//curl part
set_time_limit(0);
$ch = curl_init();
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 0);
curl_setopt($ch, CURLOPT_URL, $file);
$data = curl_exec($ch);
curl_close($ch);
//output
echo $data;