nadeemshafi9 Posted September 2, 2006 Share Posted September 2, 2006 hi againi am having trouble readin my audio data to place it into a db here is the code in questionhere is the form that i use[code] <form action="add_audio.php" method="post" name="frmdetails" enctype="multipart/form-data"> audio <input name="fileaudio" type="file" accept="audio/basic"> <br> <input name="submit" type="submit" value="Submit"> </form>[/code]here is the troubled code[code] $audiodata = $_FILES['fileaudio']['tmp_name']; $audiodata = addslashes(fread(fopen($audiodata, "r"), filesize($audiodata)));[/code]the prob occurs here the error is, [quote]PHP Warning: fread(): supplied argument is not a valid stream resource in c:\Inetpub\wwwroot\audio_test\add_audio.php on line 20 [/quote] thanx very much for any help Quote Link to comment Share on other sites More sharing options...
shocker-z Posted September 2, 2006 Share Posted September 2, 2006 $audiodata = $_FILES['fileaudio']['tmp_name']; $fopen=fopen($audiodata, "r");$size=filesize($audiodata);$fread=fread($fopen, $size);$audiodata = addslashes($fread);try that... not tested.. but i think it's mainly because of the functions working inside a function and reading the file at same time as checking it... Quote Link to comment Share on other sites More sharing options...
nadeemshafi9 Posted September 2, 2006 Author Share Posted September 2, 2006 ok i tryed that know its still having a prob with fread due to fopen, the same error (not a valid stream resource), the file is infact an mp3 file, and in the form iv speccified basic audio, and multipart form data.there seems to be a loss in the file post,thancks for any further assistance. Quote Link to comment Share on other sites More sharing options...
nadeemshafi9 Posted September 2, 2006 Author Share Posted September 2, 2006 i tried a smaller midi sequence file a couple of k and it woorked,the one i used before was mp3 and was 5 mb so i think there is a limitation here or somthing if anyone has any ideas to how to overcome this please feel free to help.thanx all 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.