Nositi Posted January 23, 2009 Share Posted January 23, 2009 Hi, I found a bunch of tutorials and they all seem to do it the same way. For whatever reason, though, the file doesn't seem to be getting onto the server and I have no idea why. Here's the form: <html> <head> <title> File upload </title> </head> <body> <form action="process_file.php" method="post"><br/> Filename: <input type="file" name="uploadFile" value="uploadFile"> <input type="submit" value="Upload File"/> </form> </body> </html> process_file.php: <html> <head> <title>Processing uploaded file</title> </head> <body> <?php print $_FILES["uploadFile"]["name"] . $_FILES["uploadFile"]["type"] . $_FILES["uploadFile"]["size"] . $_FILES["uploadFile"]["tmp_name"] . $_FILES["uploadFile"]["error"]; ?> </body> </html> I've completely eliminated move_uploaded_file for now, because obviously there's no point if there's nothing there in the first place. So why might this not be working? I can post text just fine. Thanks. Link to comment https://forums.phpfreaks.com/topic/142178-solved-trying-to-upload-file-with-post/ Share on other sites More sharing options...
gevans Posted January 23, 2009 Share Posted January 23, 2009 Check out this tutorial Currently your form is wrong and the image will not be sent in POST data Link to comment https://forums.phpfreaks.com/topic/142178-solved-trying-to-upload-file-with-post/#findComment-744824 Share on other sites More sharing options...
bluesoul Posted January 24, 2009 Share Posted January 24, 2009 In case the tutorial makes your eyes glaze over, the major bug is in your <form> tag, but that's a handy enough tutorial I'm not gonna tell you what it is. Link to comment https://forums.phpfreaks.com/topic/142178-solved-trying-to-upload-file-with-post/#findComment-744886 Share on other sites More sharing options...
Nositi Posted January 24, 2009 Author Share Posted January 24, 2009 So I was just missing the param enctype="multipart/form-data". Awesome, thanks guys. Link to comment https://forums.phpfreaks.com/topic/142178-solved-trying-to-upload-file-with-post/#findComment-744896 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.