Lo que pretendes es algun tipo de backup?
Si tienes errores de tiempo o tamaño de ejecución usa ini_set para cerciorar que cumples los parametros dados
Código PHP:
Ver originalini_set( 'memory_limit', 'value' ); //value in Mb end with M, ex: 50M, 50mb max send ini_set('upload_max_filesize', 'value'); //equal up ini_set('post_max_size', 'value'); //equal up ini_set('max_input_time', secs
); //max time of excecution script in seconds ini_set('max_execution_time', secs
); //equal up
En cuanto a enviar archivos mediante a curl usa esto:
Código PHP:
Ver original$url = "http://127.0.0.1/dir/send.php"; //target url
$file = "backup.zip"; //the file
$postName = "files"; //post file name in server, ex. $_FILES["files"][properities]
$timeout = 100; //timeout of excecution, in secs
$post = array($postName => $cfile );
curl_setopt($ch, CURLOPT_HTTPHEADER
,array('Content-Type: multipart/form-data'));
if($result === false){
//to do if error
}
else{
//to do if success
}
Del lado del servidor usas, tu rutina, pero con $_FILES[send], donde send = $postName del código que te di
P.S: a mi me funciona si a ti no revisa las opciones de seguridad
Edito, no vi tu edición, mira mientras consigas lo que necesitas está bien, eso si asegura que la conexión a ftp sea segura, si eso esta bien, todo ok.
Saludos