Jump to content

is_uploaded_file problem


robert_gsfame

Recommended Posts

i have a this script

 

move_uploaded_file($_FILES['ufile']['tmp_name'][1],$path1);

if(is_uploaded_file($_FILES['ufile']['tmp_name'][1])){

echo "Upload successful";}

 

i get file that has been uploaded inside upload folder but i dont know why the echo "Upload successful" didnt appear

 

thx

Link to comment
https://forums.phpfreaks.com/topic/209113-is_uploaded_file-problem/
Share on other sites

Because you move it from spot X to spot Y, and then check spot X to see if it is there (which it isn't).  :P  Try:

 

if(is_uploaded_file($_FILES['ufile']['tmp_name'][1])){
   if(move_uploaded_file($_FILES['ufile']['tmp_name'][1],$path1)) {
      echo "Upload successful";
   }
}

thx a lot it works...but i still confused  :confused: :confused:

 

Is it true that is_uploaded_file used to check whether the file has been successfully uploaded??

 

if it is, then logically we have to upload the file first into the upload folder before check it....could you give me some explanation for this.... i always use copy() n wish to learn how to use move_uploaded_file as it is much safer  :)

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.