I've have the below code and its works fine, how can I get the file to prompt the user to save it instead of specifying a path on the server to save it?
I have to use curl due to hosting and memory issues on the hosting.
Any help much appreciated.
I have to use curl due to hosting and memory issues on the hosting.
Any help much appreciated.
Code:
<?php
$contentType = 'text/plain';
$file = 'http://mysite.com/test.txt';
$fp = fopen('/path/to/save/mytest.txt', 'w');
$ch = curl_init($file);
curl_setopt($ch, CURLOPT_FILE, $fp);
$data = curl_exec($ch);
curl_close($ch);
fclose($fp);
?>
Comment