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 Quote Link to comment 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. Quote Link to comment Share on other sites More sharing options...
PyraX Posted August 5, 2007 Author Share Posted August 5, 2007 Im hosting locally Quote Link to comment 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. Quote Link to comment 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 ) ) Quote Link to comment 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 Quote Link to comment 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> Quote Link to comment 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 Quote Link to comment 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 Quote Link to comment Share on other sites More sharing options...
play_ Posted August 6, 2007 Share Posted August 6, 2007 click the "sovled" button Quote Link to comment 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.