Mudsaf Posted October 20, 2012 Share Posted October 20, 2012 Hello everybody, i got form with 2x file upload fields. <form action='Proceed.php' method='post' enctype='multipart/form-data'> <label for='imagefile'>Image (.JPG):</label> <input id='form_addgame' type='file' name='imagefile' id='imagefile' /><input type="hidden" name="MAX_FILE_SIZE_IMG" value="3000000" /> <!-- 3000 KB --> <label for='flashfile'>Flash (.SWF):</label> <input id='form_addgame' type='file' name='flashfile' id='flashfile' /><input type="hidden" name="MAX_FILE_SIZE_SWF" value="5000000" /> <!-- 5000 KB --></form> When i proceed to confirmation page i get this error echo "Image file format: " . $_FILES['imagefile']['type']; //PASTES image/jpegecho "Flash file format: " . $_FILES['flashfile']['type']; //DOESNT PASTE ANYTHING Im not sure howto fix this problem O_o Link to comment Share on other sites More sharing options...
Ixzion Posted October 20, 2012 Share Posted October 20, 2012 (edited) I'm getting this when check for a post when I submit the form to itself: Image file format: image/jpegFlash file format: application/x-shockwave-flash So I think your code is okay. I don't know what the cause of it is, unfortunately. But here's my full code. Maybe it will help: <?phpif ($_POST) { echo "Image file format: " . $_FILES['imagefile']['type']; //PASTES image/jpeg echo "<br>"; echo "Flash file format: " . $_FILES['flashfile']['type']; //DOESNT PASTE ANYTHING} ?><form action="self.php" method='post' enctype='multipart/form-data'> <label for='imagefile'>Image (.JPG):</label> <input id='form_addgame' type='file' name='imagefile' id='imagefile' /><input type="hidden" name="MAX_FILE_SIZE_IMG" value="3000000" /> <!-- 3000 KB --> <label for='flashfile'>Flash (.SWF):</label> <input id='form_addgame' type='file' name='flashfile' id='flashfile' /><input type="hidden" name="MAX_FILE_SIZE_SWF" value="5000000" /> <!-- 5000 KB --><input type="submit" /></form> Edited October 20, 2012 by Ixzion 1 Link to comment Share on other sites More sharing options...
Mudsaf Posted October 20, 2012 Author Share Posted October 20, 2012 I'm getting this when check for a post when I submit the form to itself: So I think your code is okay. I don't know what the cause of it is, unfortunately. But here's my full code. Maybe it will help: <?phpif ($_POST) { echo "Image file format: " . $_FILES['imagefile']['type']; //PASTES image/jpeg echo "<br>"; echo "Flash file format: " . $_FILES['flashfile']['type']; //DOESNT PASTE ANYTHING} ?><form action="self.php" method='post' enctype='multipart/form-data'> <label for='imagefile'>Image (.JPG):</label> <input id='form_addgame' type='file' name='imagefile' id='imagefile' /><input type="hidden" name="MAX_FILE_SIZE_IMG" value="3000000" /> <!-- 3000 KB --> <label for='flashfile'>Flash (.SWF):</label> <input id='form_addgame' type='file' name='flashfile' id='flashfile' /><input type="hidden" name="MAX_FILE_SIZE_SWF" value="5000000" /> <!-- 5000 KB --><input type="submit" /></form> Thanks for reply, copyed ur form code + removed the double ID what was added 2 times (form_addgame) and somehow now it works Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now