PyraX Posted August 5, 2007 Share Posted August 5, 2007 Hi im using forms to upload files and it seems to be ok with most things but not .mp3 form code is: method post <input type='hidden' name='MAX_FILE_SIZE' value='100000000' /> <input type='hidden' name='upload' value='true' /> Choose a news .pdf to upload. <input name='uploadedfile' size='37' type='file' /> take upload if(move_uploaded_file($_FILES['uploadedfile']['tmp_name'], $target_path)) { echo ""; } else{ echo "There was an error uploading the file, please try again!"; } Thanks in advance Link to comment https://forums.phpfreaks.com/topic/63468-solved-mp3-upload-error/ Share on other sites More sharing options...
deadimp Posted August 5, 2007 Share Posted August 5, 2007 Notify your host's support system. It could be that they don't allow .mp3 files. Link to comment https://forums.phpfreaks.com/topic/63468-solved-mp3-upload-error/#findComment-316282 Share on other sites More sharing options...
PyraX Posted August 5, 2007 Author Share Posted August 5, 2007 Im hosting locally Link to comment https://forums.phpfreaks.com/topic/63468-solved-mp3-upload-error/#findComment-316284 Share on other sites More sharing options...
deadimp Posted August 5, 2007 Share Posted August 5, 2007 Have you checked whether it's the filesize? Also, why do you store the max filesize in your form? Someone could easily recreate a form and set that limit to whatever they choose. It's better to store the limit in your script. Link to comment https://forums.phpfreaks.com/topic/63468-solved-mp3-upload-error/#findComment-316287 Share on other sites More sharing options...
PyraX Posted August 5, 2007 Author Share Posted August 5, 2007 Check it just then here is the print_r($_files) at the other end Array ( [uploadedfile] => Array ( [name] => file.mp3 [type] => [tmp_name] => [error] => 1 => 0 ) ) Link to comment https://forums.phpfreaks.com/topic/63468-solved-mp3-upload-error/#findComment-316289 Share on other sites More sharing options...
teng84 Posted August 5, 2007 Share Posted August 5, 2007 are you sure about the size of that remember size is limited in uploading a file and maybe you have to post the whole code that uploads the file Link to comment https://forums.phpfreaks.com/topic/63468-solved-mp3-upload-error/#findComment-316291 Share on other sites More sharing options...
PyraX Posted August 6, 2007 Author Share Posted August 6, 2007 <form id='form1' name='form1' enctype='multipart/form-data' method='POST' action='admin.php?do=news2'> <table width='500' border='0' cellpadding='2' cellspacing='2' bgcolor='#F2F2F2'> <tr> <td>Details</td> <td><input type='hidden' name='MAX_FILE_SIZE' value='100000000' /> <input type='hidden' name='upload' value='true' /> Choose a media .pdf or to upload. <input name='uploadedfile' size='37' type='file' /><br /> </td> </tr> <tr> <td> </td> <td><div align='center'> <label> <input type='submit' name='takeme' value='Submit' /> </label> </div></td> </tr> </table> </form> Link to comment https://forums.phpfreaks.com/topic/63468-solved-mp3-upload-error/#findComment-316327 Share on other sites More sharing options...
redarrow Posted August 6, 2007 Share Posted August 6, 2007 set these in php.ini memory_limit = 128M post_max_size = 64M upload_max_filesize = 32M Link to comment https://forums.phpfreaks.com/topic/63468-solved-mp3-upload-error/#findComment-316337 Share on other sites More sharing options...
PyraX Posted August 6, 2007 Author Share Posted August 6, 2007 Thanks redarrow fixed by adding php_value upload_max_filesize 10M php_value post_max_size 20M to .htaccess Link to comment https://forums.phpfreaks.com/topic/63468-solved-mp3-upload-error/#findComment-316345 Share on other sites More sharing options...
play_ Posted August 6, 2007 Share Posted August 6, 2007 click the "sovled" button Link to comment https://forums.phpfreaks.com/topic/63468-solved-mp3-upload-error/#findComment-316348 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.