leequalls Posted June 30, 2012 Share Posted June 30, 2012 I have a form here http://party934.com/artist_contact.php that is supposed to upload 2 files. When the submit button is clicked the files do not upload however the data in the form is being sent. This is how Im calling the files on submit: $file_temp = $_FILES['mp3']['tmp_name']; $mp3name = $_FILES['mp3']['name']; $file_size = $_FILES['mp3']['size']; $file_err = $_FILES['mp3']['error']; $ifile_temp = $_FILES['image']['tmp_name']; $imagename = $_FILES['image']['name']; $ifile_size = $_FILES['image']['size']; $ifile_err = $_FILES['image']['error']; Quote Link to comment https://forums.phpfreaks.com/topic/265023-file-upload/ Share on other sites More sharing options...
PFMaBiSmAd Posted June 30, 2012 Share Posted June 30, 2012 Your <form ... tag does not have the enctype attribute that is needed to allow files to be uploaded and you are missing a closing </form> tag. I recommend reading the upload handling section in the php.net documentation - http://us.php.net/manual/en/features.file-upload.php Quote Link to comment https://forums.phpfreaks.com/topic/265023-file-upload/#findComment-1358083 Share on other sites More sharing options...
rythemton Posted June 30, 2012 Share Posted June 30, 2012 This is actually a problem with your encapsulation type in the form itself. You need to set the form to be a multipart encapsulation: <form enctype="multipart/form-data" action="yada.php" method="post"> The multipart is needed because you are dealing with binary data. Quote Link to comment https://forums.phpfreaks.com/topic/265023-file-upload/#findComment-1358085 Share on other sites More sharing options...
leequalls Posted June 30, 2012 Author Share Posted June 30, 2012 Thanks I over looked that. Quote Link to comment https://forums.phpfreaks.com/topic/265023-file-upload/#findComment-1358086 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.