im trying to download a file from a url, when I use the browser the download dialog works but when I use this code the new file on my server stay empty.
$ch = curl_init(); $source = "https://myapps.gia.edu/ReportCheckPortal/downloadReport.do?reportNo=$row['certNo']&weight=$row['carat']"; curl_setopt($ch, CURLOPT_URL, $source); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); $data = curl_exec ($ch); curl_close ($ch); $destination = "./files/certs/$row['certNo'].pdf"; $file = fopen($destination, "w+"); fputs($file, $data); fclose($file); example of url: https://myapps.gia.edu/ReportCheckPortal/downloadReport.do?reportNo=1152872617&weight=1.35
{}e.g."text{$array['key']}".