tomjung09 Posted April 28, 2009 Share Posted April 28, 2009 It seems like nothing is going right for me here lol. I am trying to upload a file from the clients computer to the server. I have been testing my code for about 2 hours and I cannot figure out why this does not work: original file: <input type="file" name="txtimage1"/> Upload file: $test = $_POST['txtimage1']; echo "test " . $test . " \n"; if ($_FILES["txtimage1"]["error"] > 0) { echo "Error: " . $_FILES["txtimage1"]["error"] . "<br />"; } else { echo "Upload: " . $_FILES["txtimage1"]["name"] . "<br />"; echo "Type: " . $_FILES["txtimage1"]["type"] . "<br />"; echo "Size: " . ($_FILES["txtimage1"]["size"] / 1024) . " Kb<br />"; echo "Stored in: " . $_FILES["txtimage1"]["tmp_name"]; } test prints out the path that was inputed to txtimage1, but everything else outputs nothing. Could this be a server side issue or am I missing something? Link to comment https://forums.phpfreaks.com/topic/155996-solved-_files-not-coming-up-with-anything/ Share on other sites More sharing options...
tomjung09 Posted April 28, 2009 Author Share Posted April 28, 2009 I am using the form: <form id="form1" name="form1" method="post" action="uploadbikesubmit.php"> to submit Link to comment https://forums.phpfreaks.com/topic/155996-solved-_files-not-coming-up-with-anything/#findComment-821215 Share on other sites More sharing options...
tomjung09 Posted April 28, 2009 Author Share Posted April 28, 2009 Wow this was a headache. I figured it out, you have to have: <form id="form1" name="form1" method="post" enctype="multipart/form-data" action="uploadbikesubmit.php"> enctype="multipart/form-data" in the form settings. Link to comment https://forums.phpfreaks.com/topic/155996-solved-_files-not-coming-up-with-anything/#findComment-821243 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.