failed to open stream : Is a directory in

ε祈祈猫儿з 提交于 2019-12-23 09:01:40

问题


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);

回答1:


It seems like your name is null

$destination = "test/". $name;

echo you name and see what is coimg there.




回答2:


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.



来源:https://stackoverflow.com/questions/14560658/failed-to-open-stream-is-a-directory-in

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!