简体   繁体   中英

[function.move-uploaded-file]: failed to open stream: No such file or directory

my code works fine in WAMP server without any warning. But when I upload same code on my server it shows me these arror.

[function.move-uploaded-file]: failed to open stream: No such file or directory

my php file contain following line. $ran is random name generated by system. I want file name hidden, so I kept random function for that.

move_uploaded_file($_FILES['file']['tmp_name'], "users/jagdish/".$ran);

I also tried full path "/home/user/public_html/" instead of giving only "users/".

There are two errors. My upload.php is located at /public_html/jagdish/upload/upload.php

Warning: move_uploaded_file(/home/noyosdzy/public_html/jagdish/upload/users/jagdish/d406235ed72be6c41dbe2c00798a6e86fc28510f1359788762) [function.move-uploaded-file]: failed to open stream: No such file or directory in /home/noyosdzy/public_html/jagdish/upload/upload.php on line 118

Warning: move_uploaded_file() [function.move-uploaded-file]: Unable to move '/tmp/php3ww2M8' to '/home/noyosdzy/public_html/jagdish/upload/users/jagdish/d406235ed72be6c41dbe2c00798a6e86fc28510f1359788762' in /home/noyosdzy/public_html/jagdish/upload/upload.php on line 118

I tried different combinations also. But doesn't work. It works perfectly on WAMP. But not working on my web server.

i had a similar issue, but to be frank my issue was with a pipe character in the filename. please check whether your filename has any special characters.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM