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']; 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 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. 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. Link to comment https://forums.phpfreaks.com/topic/265023-file-upload/#findComment-1358086 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.