robert_gsfame Posted July 28, 2010 Share Posted July 28, 2010 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 Quote Link to comment https://forums.phpfreaks.com/topic/209113-is_uploaded_file-problem/ Share on other sites More sharing options...
AbraCadaver Posted July 28, 2010 Share Posted July 28, 2010 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). Try: if(is_uploaded_file($_FILES['ufile']['tmp_name'][1])){ if(move_uploaded_file($_FILES['ufile']['tmp_name'][1],$path1)) { echo "Upload successful"; } } Quote Link to comment https://forums.phpfreaks.com/topic/209113-is_uploaded_file-problem/#findComment-1092145 Share on other sites More sharing options...
robert_gsfame Posted July 28, 2010 Author Share Posted July 28, 2010 thx a lot it works...but i still 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 Quote Link to comment https://forums.phpfreaks.com/topic/209113-is_uploaded_file-problem/#findComment-1092147 Share on other sites More sharing options...
PFMaBiSmAd Posted July 28, 2010 Share Posted July 28, 2010 Is it true that is_uploaded_file used to check whether the file has been successfully uploaded?? Why don't you just read the php.net documentation to find out what it does do - is_uploaded_file Quote Link to comment https://forums.phpfreaks.com/topic/209113-is_uploaded_file-problem/#findComment-1092176 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.