Unfortunately, I cannot use either fopen or file_get_contents, so my working script has become a broken one using cURL:
$ch = curl_init();
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$tmp = curl_exec($ch);
curl_close($ch);
header("Content-type: application/csv");
header(Content-Disposition: attachment; filename=$start.csv");
header("Pragma: no-cache");
header("Expires: 0");
echo $tmp;
URL going in is a CSV file – and the fopen version of this worked before. All I get is an empty CSV file returned to the browser.
Thanks.
Ok there could be a couple of places which went wrong, most likely the $tmp variable will be your key.
I am assuming the $url and $start variables have been declared correctly
First thing I would suggest is to do something along the lines of:
Might give you an idea about what is going wrong