PHP文件上传不上传

时间:2014-05-26 08:23:39

标签: 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   = 'uploads/' . basename( $_FILES['profpic']['name']); 
     move_uploaded_file($_FILES['profpic']['tmp_name'], $target_path);

这是应该去的地方:

C:\ XAMPP \ htdocs中\诺尔\上传

1 个答案:

答案 0 :(得分:1)

$target_path

中尝试此绝对路径
$target_path   = $_SERVER['DOCUMENT_ROOT'].'/noel/uploads/' . basename( $_FILES['profpic']['name']);