w_windows上的move_uploaded_file()错误

Warning: move_uploaded_file(C:\wamp\www/uploads/a.mp3): failed to open stream: No such file or directory in C:\wamp\www\display\uploadfile.php on line 206 Warning: move_uploaded_file(): Unable to move 'C:\wamp\tmp\php75FD.tmp' to 'C:\wamp\www/uploads/a.mp3' in C:\wamp\www\display\uploadfile.php on line 206 

的var_dump:

 array (size=1) 'file' => array (size=5) 'name' => string 'a.mp3' (length=5) 'type' => string 'audio/mp3' (length=9) 'tmp_name' => string 'C:\wamp\tmp\php75FD.tmp' (length=23) 'error' => int 0 'size' => int 4030592 

tmp和上传目录的权限设置为everyone>完全权限

PHP已经正确上传文件大小

我不知道为什么文件不会上传…

编辑:代码: http : //pastebin.com/kFG2v2PJ

Solutions Collecting From Web of "w_windows上的move_uploaded_file()错误"

问题: C:\wamp\www/uploads/

改变您的斜线反斜杠,并确保目录C:\wamp\www\uploads\存在。 您可以使用DIRECTORY_SEPARATOR常量使您的代码在多个系统上工作。

另外,没有看到你的代码,你需要确保你把正确的参数在move_uploaded_file()

编码后编辑:

更改

 $target_path = APP_PATH."/uploads/"; 

 $target_path = APP_PATH . DIRECTORY_SEPARATOR . "uploads" . DIRECTORY_SEPARATOR; 

你的/ uploads目录是否存在? 如果是,那么检查var_dump($_FILES)检查$_FILES['uploaded']['error'] 。 包含0,表示“没有错误”