i try download file ftp server client. if use ftp_get, file downloaded php server, can write output browser. download process is
ftp server -> php server -> client this doubles traffic - bad in downloading big files. there way how write file directly browser described here: stream ftp download output - data flows through php server anyway, right?
is there way how establish download (if yes, how?), or principially impossible?
ftp server -> client edit: should work non-anonymous ftp servers in secure way.
try below code that.
$curl = curl_init(); $file = fopen("ls-lr.gz", 'w'); curl_setopt($curl, curlopt_url, "ftp://ftp.sunet.se/ls-lr.gz"); #input curl_setopt($curl, curlopt_file, $file); #output curl_setopt($curl, curlopt_userpwd, "$_ftp[username]:$_ftp[password]"); curl_setopt($curl, curlopt_returntransfer, 1); curl_exec($curl); thanks.
Comments
Post a Comment