Mp3 file upload problem

Thread Solved

Join Date: Sep 2009
Posts: 557
Reputation: network18 is an unknown quantity at this point 
Solved Threads: 64
network18 network18 is offline Offline
Posting Pro
 
0
  #11
Nov 4th, 2009
try with another mp3 file having small size and post your entire code here.
and you seem to be confused, first decide which file types you want to restrict and which file types you want to allow.accordingly we will proceed with the code.
"The discipline of writing something down is the first step towards making it happen."

follow me on twitter
Reply With Quote Quick reply to this message  
Join Date: Aug 2008
Posts: 161
Reputation: sarithak is an unknown quantity at this point 
Solved Threads: 6
sarithak sarithak is offline Offline
Junior Poster
 
0
  #12
Nov 4th, 2009
Originally Posted by network18 View Post
try with another mp3 file having small size and post your entire code here.
and you seem to be confused, first decide which file types you want to restrict and which file types you want to allow.accordingly we will proceed with the code.

hi...

this is my code...its working fine for all(including MP3)...but upto 5MB files only uploaded..8,9,11MB files are not uploaded..

  1. $aid = mysql_real_escape_string($_POST['albumname']);
  2. $song = mysql_real_escape_string($_POST['song']);
  3. $singers = mysql_real_escape_string($_POST['singers']);
  4. $tname = mysql_real_escape_string($_FILES["tphoto"]["name"]);
  5. $ttmp_name = $_FILES["tphoto"]["tmp_name"];
  6.  
  7. //Audio File Uploading....
  8. //if (($_FILES["tphoto"]["type"] == "*.MP3")){ //not working when i use if condition..
  9. $dir="../../music/$aid";
  10. move_uploaded_file($ttmp_name,"$dir"."/"."$tname");
  11.  
  12.  
  13. $sql="insert into music_songs values('','$aid','$song','$singers','$tname')";
  14. $res=mysql_query($sql)or die(mysql_error());
  15.  
  16. //}

another one...now i m working on localhost....
My best wishes ... from my soul ... for everyone!
Keep Smiling....Never Depress
Reply With Quote Quick reply to this message  
Join Date: Sep 2009
Posts: 557
Reputation: network18 is an unknown quantity at this point 
Solved Threads: 64
network18 network18 is offline Offline
Posting Pro
 
0
  #13
Nov 4th, 2009
is "audio/mp3" and "MP3" same for you ?
"The discipline of writing something down is the first step towards making it happen."

follow me on twitter
Reply With Quote Quick reply to this message  
Join Date: Aug 2008
Posts: 161
Reputation: sarithak is an unknown quantity at this point 
Solved Threads: 6
sarithak sarithak is offline Offline
Junior Poster
 
0
  #14
Nov 4th, 2009
Originally Posted by network18 View Post
is "audio/mp3" and "MP3" same for you ?

HI..

this is not same....by mistake i put the code as ( *.MP3)... basically i checked for (audio/mp3)...its not working when i put condition there...not only for MP3...
its not working for all types of files when i use if conditon..k...also plz tell me how can i solve the MAX SIZE problem ..
My best wishes ... from my soul ... for everyone!
Keep Smiling....Never Depress
Reply With Quote Quick reply to this message  
Join Date: Sep 2009
Posts: 557
Reputation: network18 is an unknown quantity at this point 
Solved Threads: 64
network18 network18 is offline Offline
Posting Pro
 
0
  #15
Nov 4th, 2009
Again you seem to be confused.This time you are having problem with all the file types.
The max size can be set in the php.ini as, search for "upload_max_filesize" .It may have default value of 2MB at the moment edit it to have whatever you like.
"The discipline of writing something down is the first step towards making it happen."

follow me on twitter
Reply With Quote Quick reply to this message  
Join Date: Aug 2008
Posts: 161
Reputation: sarithak is an unknown quantity at this point 
Solved Threads: 6
sarithak sarithak is offline Offline
Junior Poster
 
0
  #16
Nov 5th, 2009
Originally Posted by network18 View Post
Again you seem to be confused.This time you are having problem with all the file types.
The max size can be set in the php.ini as, search for "upload_max_filesize" .It may have default value of 2MB at the moment edit it to have whatever you like.

Hi Network18,

You r correct..at that time it takes all types of files...k leave it...


I am having doubt on "upload_max_filesize" ..how can i change the values in php.ini file(which is located in server)...plz tell me is there any way to do by using coding????

i think this is stupid question, but no chance to me...


Thanks in advance..
My best wishes ... from my soul ... for everyone!
Keep Smiling....Never Depress
Reply With Quote Quick reply to this message  
Join Date: Sep 2009
Posts: 557
Reputation: network18 is an unknown quantity at this point 
Solved Threads: 64
network18 network18 is offline Offline
Posting Pro
 
0
  #17
Nov 5th, 2009
Originally Posted by sarithak View Post
Hi Network18,

You r correct..at that time it takes all types of files...k leave it...


I am having doubt on "upload_max_filesize" ..how can i change the values in php.ini file(which is located in server)...plz tell me is there any way to do by using coding????

i think this is stupid question, but no chance to me...


Thanks in advance..
Yes, you can do that by function ini_set()-
  1. //This is your new size
  2. $new_size = '3M';
  3. ini_set('upload_max_filesize',$new_size);
most of the properties in the php.ini can be set during runtime using ini_set() function.The new values last there till the script executes.
And don't worry, nothing is stupid, until you don't know it
its always good to clarify the doubts here.
"The discipline of writing something down is the first step towards making it happen."

follow me on twitter
Reply With Quote Quick reply to this message  
Join Date: Aug 2008
Posts: 161
Reputation: sarithak is an unknown quantity at this point 
Solved Threads: 6
sarithak sarithak is offline Offline
Junior Poster
 
0
  #18
Nov 5th, 2009
Originally Posted by network18 View Post
Yes, you can do that by function ini_set()-
  1. //This is your new size
  2. $new_size = '3M';
  3. ini_set('upload_max_filesize',$new_size);
most of the properties in the php.ini can be set during runtime using ini_set() function.The new values last there till the script executes.
And don't worry, nothing is stupid, until you don't know it
its always good to clarify the doubts here.

Hey...

Thanks to all....once again thanks a lot...keep it up...
My best wishes ... from my soul ... for everyone!
Keep Smiling....Never Depress
Reply With Quote Quick reply to this message  
Join Date: Aug 2008
Posts: 161
Reputation: sarithak is an unknown quantity at this point 
Solved Threads: 6
sarithak sarithak is offline Offline
Junior Poster
 
0
  #19
Nov 5th, 2009
hi sir,

This time i m getting warning

PHP Warning: POST Content-Length of 9484737 bytes exceeds the limit of 8388608 bytes in Unknown on line 0
i fixed the

  1. $new_size = '20M';
  2.  
  3. ini_set('upload_max_filesize',$new_size);


the uploading file size is 9 to 10 MB...
My best wishes ... from my soul ... for everyone!
Keep Smiling....Never Depress
Reply With Quote Quick reply to this message  
Join Date: Sep 2009
Posts: 557
Reputation: network18 is an unknown quantity at this point 
Solved Threads: 64
network18 network18 is offline Offline
Posting Pro
 
0
  #20
Nov 5th, 2009
Originally Posted by sarithak View Post
hi sir,

This time i m getting warning



i fixed the

  1. $new_size = '20M';
  2.  
  3. ini_set('upload_max_filesize',$new_size);


the uploading file size is 9 to 10 MB...
Does it solve your problem..you can supress any warning with prefixing '@' to the function like @ini_set(), eventhough i never recommend doing that.
"The discipline of writing something down is the first step towards making it happen."

follow me on twitter
Reply With Quote Quick reply to this message  
Reply

This thread has been marked solved.
Perhaps start a new thread instead?
Message:




Views: 1572 | Replies: 39
Thread Tools Search this Thread



Tag cloud for PHP
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC