您好我正在尝试上传图片,但似乎无法正常工作。而且我认为我的语法正确。你能帮我吗?感谢
$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中\诺尔\上传
答案 0 :(得分:1)
在$target_path
$target_path = $_SERVER['DOCUMENT_ROOT'].'/noel/uploads/' . basename( $_FILES['profpic']['name']);