corillo181 Posted December 15, 2007 Share Posted December 15, 2007 i had a upload script that was working fine, i havent used it for some time but today i try to test it but i'm not getting anything back from the tmp file <?php $tmpPath = $_FILES['fileMusic']['tmp_name']; $fileName= $_FILES['fileMusic']['name']; $filetype = $_FILES['fileMusic']['type']; $newName = $_POST['sname']; $genre_id = $_POST['genre']; $artist_id = $_POST['artist']; echo $tmpPath.'<br />';// returns empty - not working echo $fileName.'<br />';// returns the file name - works echo $filetype.'<br />';// returns empty - not working echo $newName.'<br />';// returns desire name - works echo $genre_id .'<br />';// returns chosen id -works echo $artist_id.'<br />';//returns chosen id - works ?> Quote Link to comment Share on other sites More sharing options...
peranha Posted December 15, 2007 Share Posted December 15, 2007 echo $artist_id.'<br />';returns chosen id - works Should this be echo $artist_id.'<br />';//returns chosen id - works Quote Link to comment Share on other sites More sharing options...
corillo181 Posted December 15, 2007 Author Share Posted December 15, 2007 LOL... that is not my problem if you see next to the echos i'm just testing, i say wich ones works and which one i'm having problems with. sorry for that. Quote Link to comment Share on other sites More sharing options...
phpSensei Posted December 15, 2007 Share Posted December 15, 2007 can you post your form please? Quote Link to comment Share on other sites More sharing options...
PFMaBiSmAd Posted December 15, 2007 Share Posted December 15, 2007 Your code should be checking the uploaded file ['error'] element - http://www.php.net/manual/en/features.file-upload.errors.php Quote Link to comment Share on other sites More sharing options...
phpSensei Posted December 15, 2007 Share Posted December 15, 2007 He could be using a bad form, with the wrong properties. Quote Link to comment Share on other sites More sharing options...
corillo181 Posted December 15, 2007 Author Share Posted December 15, 2007 my form <form action="" method="post" enctype="multipart/form-data" name="form1"> <table width="100%" border="1"> <tr> <td>artist</td> <td><label> <select name="artist" id="artist"> <?=$search->artistNames()?> </select> </label></td> </tr> <tr> <td>genre</td> <td><select name="genre" id="genre"> <?=$search->genre()?> </select></td> </tr> <tr> <td>song name</td> <td><label> <input type="text" name="sname" id="sname"> </label></td> </tr> <tr> <td>song file</td> <td><label> <input type="file" name="fileMusic" id="fileMusic"> </label></td> </tr> <tr> <td><input name="addsong" type="hidden" id="addsong" value="true" /></td> <td><button type="submit" name="submit" id="submit">Upload</button></td> </tr> </table> </form> Quote Link to comment Share on other sites More sharing options...
corillo181 Posted December 15, 2007 Author Share Posted December 15, 2007 thank you PFMaBiSmAd i forgot that i made the upload size for files smaller that was the error i need to change the upload size in my php ini. 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.