dearmoawiz Posted April 25, 2008 Share Posted April 25, 2008 hi guyzzzz howz u all i using following code for file uploading but wen i run it the message is that file already exists so can any body tell me wats problem ? my file input field name is res !!! waiting i debug it n i found the error that it didnt take any value in $_FILES["res"]["name"] this variable so plzz guide why it happening ... if($_FILES["res"]["error"]>0) { echo "Error: ". $_FILES["res"]["error"]; } else { if(!file_exists("references/". $_FILES["res"]["name"])) { echo "File already Exists "; } else { move_uploaded_file($_FILES["res"]["tmp_name"],"references/". $_FILES["res"]["name"]); } } Quote Link to comment Share on other sites More sharing options...
TEENFRONT Posted April 25, 2008 Share Posted April 25, 2008 erm if(!file_exists("references/". $_FILES["res"]["name"])) Surley that should be if(file_exists("references/". $_FILES["res"]["name"])) Quote Link to comment Share on other sites More sharing options...
dearmoawiz Posted April 25, 2008 Author Share Posted April 25, 2008 i also done it with that way but again result same ... let me paste code again if($_FILES["res"]["error"]>0) { echo "Error: ". $_FILES["res"]["error"]; } else { if(file_exists("references/". $_FILES["res"]["name"])) { echo "File already Exists "; } else { move_uploaded_file($_FILES["res"]["tmp_name"],"references/". $_FILES["res"]["name"]); } } here the out is File Already Exists ... but wen i check the folder then there is no file in that folder n if i upload any new file than also message is same Quote Link to comment Share on other sites More sharing options...
dearmoawiz Posted April 25, 2008 Author Share Posted April 25, 2008 i got the solution thnx Quote Link to comment Share on other sites More sharing options...
TEENFRONT Posted April 25, 2008 Share Posted April 25, 2008 does the folder have read/write acces CHMOD 777 ? Quote Link to comment 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.