download a file from ftp using curl and php

前端 未结 6 1639
伪装坚强ぢ
伪装坚强ぢ 2020-11-30 03:32

I\'m trying to download a file from an ftp server using curl and php but I can\'t find any documentation to help

$curl = curl_init();
curl_setopt($curl, CURL         


        
6条回答
  •  感动是毒
    2020-11-30 03:53

    See CURL help including how to connect to it via FTP here http://www.linuxformat.co.uk/wiki/index.php/PHP_-_The_Curl_library

    NOTE: IF the file can be accessed from HTTP then it is better to just use the link EG: http://host.com/file.txt and then use file_get_contents or file functions.

    You can then use http://uk.php.net/file_get_contents or any other way to download the file to your computer. This option will be better than using FTP for download. You can always use FTP to upload as mentioned in the link above.

提交回复
热议问题