This is the sort of link I want to download with:
http://username:[email protected]/dl/file.zip
Edit: stackoverflow seems to go weird with colons, its username-colon-password.
Now, if I log out of the website and use the URL pattern above, it successfully authenticates and I can successfully download the file.
I have this cURL script:
<?php
echo "Attempting to download...<br />";
$out = fopen("zip.zip", 'wb');
if ($out == FALSE){
die('File could not be opened, exiting.');
}
$ch = curl_init();
curl_setopt($ch, CURLOPT_FILE, $out);
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_URL, $file);
curl_exec($ch);
curl_close($ch);
fclose($out);
?>
And for some reason, it just downloads a 0KB file. I'm pretty sure the coding is correct, but then it can't be if it's not working.
Any help? Thanks.