curl-and-php
problems downloading files with differents ports
Date: Wed, 28 Jan 2009 12:00:17 +0100
Hi people,
I'm using PHP + curl to download from different hosts, it's working
correctly but I have problems with some URL's. I have this general
function:
function get_file1($file, $local_path, $newfilename)
{
$err_msg = '';
echo "<br>Attempting message download for $file<br>";
$out = fopen($local_path.$newfilename, 'wb');
if ($out == FALSE){
print "File not opened<br>";
exit;
}
$ch = curl_init();
curl_setopt($ch, CURLOPT_FILE, $out);
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_VERBOSE, true);
curl_setopt($ch, CURLOPT_URL, $file);
//curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_exec($ch);
echo "<br>Error is : ".curl_error ( $ch);
curl_close($ch);
fclose($handle);
}
When I try to download this file:
http://213.97.223.180:8003/AUDIO_A_LA_CARTA/28-01-2009_09-00-02_DIRECTO_
MARCA_CON_JUAN_MANUEL_GOZALO.MP3 it give me error and culr say to me:
About to connect() to 213.97.223.180 port 8003
* Trying 213.97.223.180... * Connection refused
* couldn't connect to host
* Closing connection #0
<br>Error is : couldn't connect to host
You can see that the file exist and I don't understand why I can't get
it (maybe the problem is in the port). Anyone have an idea???
Jordi.
_______________________________________________
http://cool.haxx.se/cgi-bin/mailman/listinfo/curl-and-php
Received on 2009-01-28