开发者

"Unable to access" with move_uploaded_file() PHP

The 开发者_如何学JAVAfunction move_uploaded_file() isn't working on my server and I really dont know why. the error:

Warning: move_uploaded_file() [function.move-uploaded-file]: Unable to access MYADDRESS/img-19.png in MYADDRESS/index.php on line 660

I gave to the folder which I upload files chmod 777. any solution? im sure 100% the problem isn't in my code.


Make sure you have it in the $src, $dest order:

move_uploaded_file($_FILES["field"]["tmp_name"], 'foo.png');

Also, check PHP settings, especially safe_mode and base dir restrictions.

Side note: Don't chmod your folders to be world writable! Change the group of the folder to be that of the webserver, and use 775. Last thing you need is something like an SQL injection from MySQL writing a PHP file into that folder.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜