I would like to download parts of files on a FTP server. I've got this solution:
$opts = array('ftp'=>array('overwrite'=>false, 'resume_pos'=> 5*16+12));
$context = stream_context_create($opts);
$version = file_get_contents
(
'ftp://'.$ftpAccount["username"].':'.$ftpAccount["password"].'@'.$ftpAccount["server"].'/firm/'.$file, FILE_BINARY, $context, -1, 20
);
I don't like this solution because it opens new connection for every file. Does anybody know a better solution (effective one)?
Thank you!