Ben Unsuccesfully (güvenlik etkileri vardır) ilk dosya sistemine yazmadan, bir FTP sunucusuna şifreli bir dosyayı yüklemeye çalışıyorsunuz edilmiştir
I [(3)] proc_open
kullanmaya çalışıyorsunuz ve ardından ftp_fput
ama proc_open
oluşturulan akışı {olmadığı için boşuna, sanırım edilmiştir } mümkün
İşte kod
<?php
$ciphertext = 'sadfasfasdf90809sf890as8fjwkjlf';
//The Descriptors
$descriptorspec = array(
0 => array("pipe", "r"), // stdin
1 => array("pipe", "w"), // stdout
2 => array("pipe", "w") // error
);
$process = proc_open('cat', $descriptorspec, $pipes);
if (is_resource($process)) {
fwrite($pipes[0], $ciphertext);
fclose($pipes[0]);
//Debug test to proce that $pipes[1] is a valid stream
//while(!feof($pipes[1])) {
// $content .= fgets($pipes[1],1024);
//}
//FTP connection etc etc OMMITTED to save space.
$upload = @ftp_fput($conn_id,$dir."/".$ftp_file.$extenstion,$pipes[1],FTP_BINARY);
fclose($pipes[1]);
// Check upload status
echo ('upload '. ($upload ? 'true':' false'));
}
?>
Birisi herhangi bir yenilik ya da alternatif yöntemler yardımcı veya önerebilirsiniz umuyoruz.
Teşekkürler,
Phil