When downloading an image, a warning is issued and no image is uploaded.

Source: Internet
Author: User
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 ";

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.