PHP Yükleme sorunu yanlışlık 0 ama move_uploaded_file Başlarken () false döndürüyor

0 Cevap

PHP Yükleme sorunu yanlışlık 0 ama move_uploaded_file Başlarken () false döndürüyor. Ben $ _FILES çıkacağını yazdırırken

Array ( [uploadedfile] => Array ( [name] => flashlog.txt [type] =>
text/plain [tmp_name] => /tmp/php0XYQgd [error] => 0 [size] => 3334 ) ) 

Ben bir sunucu sorunu olabilir inanmak için beni bırakır temel html / php öğretici kullanıyorum. Ben php.ini kontrol ve upload_max_filesize var: 2M, post_max_size: 8M. Ben 0 hata başarılı olduğunu söyledi düşündüm Yani ben gerçekten kafam karıştı.

Ben kullanıyorum kodu

<?php

// Where the file is going to be placed 
$target_path = 'Test/';

$target_path = $target_path. basename( $_FILES['uploadedfile']['name']); 

if(move_uploaded_file($_FILES['uploadedfile']['tmp_name'], $target_path)) 
{
 echo "The file ".  basename( $_FILES['uploadedfile']['name']). 
 " has been uploaded";
} 
else
{
 echo "There was an error uploading the file, please try again!";
 echo print_r($_FILES);
}
?>

0 Cevap