PHP文件上传不';t上传

PHP文件上传不';t上传,php,file-upload,directory,Php,File Upload,Directory,嗨,我正试图上传一个图像,但它似乎不工作。我想我的语法是对的。你能帮我吗?谢谢 $image_path = "/uploads/" . strtolower($_FILES["profpic"]["name"]); //$image_path is just that I'm getting the file name so that I can get the path and save to the database $target_path = '

嗨,我正试图上传一个图像,但它似乎不工作。我想我的语法是对的。你能帮我吗?谢谢

     $image_path    = "/uploads/" . strtolower($_FILES["profpic"]["name"]);
     //$image_path is just that I'm getting the file name so that I can get the path and save to the database

     $target_path   = 'uploads/' . basename( $_FILES['profpic']['name']); 
     move_uploaded_file($_FILES['profpic']['tmp_name'], $target_path);
这里是它应该去的地方:


C:\xampp\htdocs\noel\uploads

$target\u path

$target_path   = $_SERVER['DOCUMENT_ROOT'].'/noel/uploads/' . basename( $_FILES['profpic']['name']);