Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

function is_uploaded_file( ) not working .. always returns a false flag

I am uploading a file through PHP scipt ..

my code is

$file_temp=$_FILES["upl"]["tmp_name"];

when i upload stuffs with

move_upload_file($file_temp,"user_stuff/".$file_name)

Everything works fine .. stuff get uploaded with no disaster

But when i check the uploaded file to be actually in the area using

is_uploaded_file($file_temp);

It always return false

So i googled the problem and it redirected me to the same stackoverflow problem here

so i did , as it was suggested

 if(is_uploaded_file(realpath($file_temp)))
        {
            echo "done";
        }
        else
        {
            echo "fail";
        }

But still getting the same problem "fail"

Moreover, i just noticed a strange thing ... when i am not using move_uploaded_file(..) , the is_uploaded_file "works"

like image 571
Zafta Avatar asked Nov 11 '22 20:11

Zafta


1 Answers

try sudo chmod 777 path_to_directory/user_stuff/ -R in your console

like image 87
BlackWhite Avatar answered Nov 15 '22 06:11

BlackWhite