When uploading an image, a warning is issued and no image is uploaded. $ Upload_dir & nbsp; = & nbsp ;"? User_img "; & nbsp; move_uploaded_file ($ _ FILES [" logo_file1 "] [" tmp_name "], $ upload_dir." when uploading an image, a warning is issued and no image is uploaded.
$upload_dir = "?user_img";
move_uploaded_file($_FILES["logo_file1"]["tmp_name"],$upload_dir."/".$_FILES["logo_file1"]["name"]);
This is the code for uploading images. why is there always a warning?
The file of this code is in the _ test Directory of the root directory.
There are no images in the user_img in the root directory.
There are no images in _ test \ user_img,
I want to upload the image to user_img in the root directory.
Warning: move_uploaded_file (? User_img/r6s2g3.gif) [function. move-uploaded-file]: failed to open stream: No such file or directory in/home/hosting_users/kr_mall24/www/_ test/post_ OK .php on line 53
Warning: move_uploaded_file () [function. move-uploaded-file]: Unable to move '/tmp/phpxJHvyD' '? User_img/r6s2g3.gif 'in/home/hosting_users/kr_mall24/www/_ test/post_ OK .php on line 53
------ Solution --------------------
Check if the path is wrong without this file.
------ Solution --------------------
$ Upload_dir = "/www? User_img ";