failed to open stream : Is a directory in

2019-06-20 04:01发布

I am getting the following warnings on trying on move an uploaded file from the temp folder to the desired one using php

Warning: move_uploaded_file(test/) [function.move-uploaded-file]: failed to open stream: Is a directory in /home/..../filename.php on line 69

Warning: move_uploaded_file() [function.move-uploaded-file]: Unable to move '/tmp/phpKrCpQw' to 'test/' in /home/..../filename.php on line 69

following are line nos 67 and 69 that are giving the error :

$destination = "test/". $name;

$answer = move_uploaded_file($_FILES['user_file']['tmp_name'],$destination);

2条回答
女痞
2楼-- · 2019-06-20 04:28

For me, it was the filesize.

So, check php.ini to see if the uploaded file exceeds upload_max_filesize and post_max_size.

Or maybe add a validation rule in Laravel or js.

查看更多
Rolldiameter
3楼-- · 2019-06-20 04:41

It seems like your name is null

$destination = "test/". $name;

echo you name and see what is coimg there.

查看更多
登录 后发表回答