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

curl-and-php

RE: problems downloading files with differents ports

From: Jordi Agusti Fonoll <jagusti_at_ivoox.com>
Date: Wed, 28 Jan 2009 13:12:03 +0100

Hi Charoite,

 

I've added this: curl_setopt($ch, CURLOPT_PORT, 8003); and the problem
persists. Curl take the port because it give 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

 

I'm trying a lot of different options but without any exit.

 

Regards.

 

De: curl-and-php-bounces_at_cool.haxx.se
[mailto:curl-and-php-bounces_at_cool.haxx.se] En nombre de Charoite Lee
Enviado el: 2009-01-28 12:47
Para: curl with PHP
Asunto: Re: problems downloading files with differents ports

 

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