Jump to content

Connecting to FTP through curl


kalpana

Recommended Posts

hi,

 

i have a code to connect to ftp using curl. It works in my local system but when i upload it to the server, nothing is displayed. Can some one help me out to sort this problem.

 

Here is my code:

 

  <?

  set_time_limit(100000);

 

  $curl = curl_init() or die(curl_error($curl));

  $ftp_server = "ftp://username:[email protected]";

     

  curl_setopt($curl, CURLOPT_URL, $ftp_server);   

       

  curl_setopt($curl, CURLOPT_TIMEOUT, 40000);   

   

  curl_setopt($curl, CURLOPT_FTPLISTONLY, 1);

  ob_start();

  curl_exec ($curl) or die(curl_error($curl));

  ob_end_clean();

  curl_close ($curl);

?>

 

Is there any thing wrong in this code?

 

 

Link to comment
https://forums.phpfreaks.com/topic/88548-connecting-to-ftp-through-curl/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.