cURL / Mailing Lists / curl-and-php / Single Mail

curl-and-php

Re: problems downloading files with differents ports

From: Charoite Lee <charoitelee_at_rhoware.com>
Date: Wed, 28 Jan 2009 19:46:49 +0800

Hi Jordi,

Have you try to set the *CURLOPT_PORT* option to 8003. Please see
http://www.php.net/manual/en/function.curl-setopt.php for details. Hope
this could help.

Regards,
Charoite

Jordi Agusti Fonoll wrote:
>
> 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
>

_______________________________________________
http://cool.haxx.se/cgi-bin/mailman/listinfo/curl-and-php
Received on 2009-01-28