Kesinlikle.
Ben neden) (ftp_site kullandığınızdan emin değilim. Eğer başka bir sunucuya yüklenen dosyayı FTPing, ya da sadece bir yükleme formu yapmaya çalışıyorum o php dosyasını hizmet ediyor, aynı makineye yüklenenler? Hazır
Eğer komut dosyası çalıştıran sunucuya yüklenenler üzerinde çalışıyoruz varsayarsak, bir kaç şey vardır. Web sunucusu (httpd, apache, lighttpd, veya benzeri) olarak çalıştıran kullanıcı $ uploadPath yazma erişimi olduğundan emin olun. Bunu yapmak için, sen ona 0777 chmod olabilir, ama sistemde herhangi bir kullanıcı, şimdi bu klasöre yazabilirsiniz, ve biz sadece apache edebilmek istiyorum bu, güvensizdir. Bu kısmı kurma yardıma ihtiyacınız varsa http://yaauie.com/me yoluyla bana ulaşın; Ben komut satırından nasıl rahat emin değilim ve jibberjabber ile sizi mahçup etmek istemiyorum
Burada yakalandığını nereye gidermenize yardımcı olacak bazı pratik prosedürel kod; test etmek için bu komut adresinden yükleme formu etmektedir.
<?php
// Set the upload path
$uploadPath = realpath('./images/thumbs/');
// test to see if the upload path is a directory that is writable
if(is_dir($uploadPath) && is_writable($uploadPath)) {
// create the full path for the end result file
$uploadFile = $uploadPath.basename($_FILES['userfile']['name']);
// try to move the uploaded file
if(move_uploaded_file($_FILES['userfile']['tmp_name'], $uploadFile)) {
echo 'Sucessfully moved file to "'.$uploadFile.'"';
} else {
echo 'Directory is writable, but we could not move the uploaded file to it.';
}
} else {
echo 'Either "'.$uploadPath.'" is not a directory, or it is not writable.';
}
?>