-3
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 和上传目录的权限设置为所有人 > 完全权限

PHP 已正确设置上传文件大小

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

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

4

2 回答 2

6

问题: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;
于 2013-04-11T10:21:38.127 回答
0

is your /uploads directory exists? if yes then check var_dump($_FILES) check if $_FILES['uploaded']['error']. contains 0, which means "no error"

于 2013-04-11T10:26:42.303 回答