adam291086 Posted September 28, 2007 Share Posted September 28, 2007 Hello i am trying to create a simplw upload. It works but the echo message is always wrong. Any ideas whats wrong. <form enctype="multipart/form-data" action="location.php" method="POST"> <input type="hidden" name="MAX_FILE_SIZE" value="100000" /> Choose a file to upload: <input name="uploadedfile" type="file" /><br /> <input type="submit" value="Upload File" /> </form> <?php // Where the file is going to be placed $target_path = "../uploads/"; /* Add the original filename to our target path. Result is "uploads/filename.extension" */ $target_path = $target_path . basename( $_FILES['uploadedfile']['name']); $_FILES['uploadedfile']['tmp_name']; $target_path = "../uploads/"; $target_path = $target_path . basename( $_FILES['uploadedfile']['name']); if(move_uploaded_file($_FILES['uploadedfile']['tmp_name'], $target_path)) { echo "The file ". basename( $_FILES['uploadedfile']['name']). " has been uploaded"; } else{ echo "There was an error uploading the file, please try again!"; } ?> Quote Link to comment https://forums.phpfreaks.com/topic/71097-simple-upload/ Share on other sites More sharing options...
BlueSkyIS Posted September 28, 2007 Share Posted September 28, 2007 are you testing with the same file each time, deleting it before each test? maybe it's not actually uploading each time? Quote Link to comment https://forums.phpfreaks.com/topic/71097-simple-upload/#findComment-357516 Share on other sites More sharing options...
adam291086 Posted September 28, 2007 Author Share Posted September 28, 2007 It not uploading at all. I have checked the sever folder Quote Link to comment https://forums.phpfreaks.com/topic/71097-simple-upload/#findComment-357518 Share on other sites More sharing options...
AdRock Posted September 28, 2007 Share Posted September 28, 2007 Does your upload folder have permissions set? Quote Link to comment https://forums.phpfreaks.com/topic/71097-simple-upload/#findComment-357546 Share on other sites More sharing options...
adam291086 Posted September 28, 2007 Author Share Posted September 28, 2007 i'm not sure. I dont think so. How can i check. im new to this Quote Link to comment https://forums.phpfreaks.com/topic/71097-simple-upload/#findComment-357547 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.