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"]); } } Link to comment https://forums.phpfreaks.com/topic/102873-problem-related-file-uploading/ 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"])) Link to comment https://forums.phpfreaks.com/topic/102873-problem-related-file-uploading/#findComment-526922 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 Link to comment https://forums.phpfreaks.com/topic/102873-problem-related-file-uploading/#findComment-526925 Share on other sites More sharing options...
dearmoawiz Posted April 25, 2008 Author Share Posted April 25, 2008 i got the solution thnx Link to comment https://forums.phpfreaks.com/topic/102873-problem-related-file-uploading/#findComment-526928 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 ? Link to comment https://forums.phpfreaks.com/topic/102873-problem-related-file-uploading/#findComment-526931 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.