944,147 Members | Top Members by Rank

Ad:
  • PHP Discussion Thread
  • Marked Solved
  • Views: 5112
  • PHP RSS
You are currently viewing page 2 of this multi-page discussion thread; Jump to the first page
Nov 4th, 2009
0
Re: Mp3 file upload problem
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.
Reputation Points: 29
Solved Threads: 76
Practically a Master Poster
network18 is offline Offline
616 posts
since Sep 2009
Nov 4th, 2009
0
Re: Mp3 file upload problem
Click to Expand / Collapse  Quote originally posted by network18 ...
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..

PHP Syntax (Toggle Plain Text)
  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....
Reputation Points: 10
Solved Threads: 7
Junior Poster
sarithak is offline Offline
183 posts
since Aug 2008
Nov 4th, 2009
0
Re: Mp3 file upload problem
is "audio/mp3" and "MP3" same for you ?
Reputation Points: 29
Solved Threads: 76
Practically a Master Poster
network18 is offline Offline
616 posts
since Sep 2009
Nov 4th, 2009
0
Re: Mp3 file upload problem
Click to Expand / Collapse  Quote originally posted by network18 ...
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 ..
Reputation Points: 10
Solved Threads: 7
Junior Poster
sarithak is offline Offline
183 posts
since Aug 2008
Nov 4th, 2009
0
Re: Mp3 file upload problem
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.
Reputation Points: 29
Solved Threads: 76
Practically a Master Poster
network18 is offline Offline
616 posts
since Sep 2009
Nov 5th, 2009
0
Re: Mp3 file upload problem
Click to Expand / Collapse  Quote originally posted by network18 ...
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..
Reputation Points: 10
Solved Threads: 7
Junior Poster
sarithak is offline Offline
183 posts
since Aug 2008
Nov 5th, 2009
0
Re: Mp3 file upload problem
Click to Expand / Collapse  Quote originally posted by sarithak ...
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()-
PHP Syntax (Toggle Plain Text)
  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.
Reputation Points: 29
Solved Threads: 76
Practically a Master Poster
network18 is offline Offline
616 posts
since Sep 2009
Nov 5th, 2009
0
Re: Mp3 file upload problem
Click to Expand / Collapse  Quote originally posted by network18 ...
Yes, you can do that by function ini_set()-
PHP Syntax (Toggle Plain Text)
  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...
Reputation Points: 10
Solved Threads: 7
Junior Poster
sarithak is offline Offline
183 posts
since Aug 2008
Nov 5th, 2009
0
Re: Mp3 file upload problem
hi sir,

This time i m getting warning

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

PHP Syntax (Toggle Plain Text)
  1. $new_size = '20M';
  2.  
  3. ini_set('upload_max_filesize',$new_size);


the uploading file size is 9 to 10 MB...
Reputation Points: 10
Solved Threads: 7
Junior Poster
sarithak is offline Offline
183 posts
since Aug 2008
Nov 5th, 2009
0
Re: Mp3 file upload problem
Click to Expand / Collapse  Quote originally posted by sarithak ...
hi sir,

This time i m getting warning



i fixed the

PHP Syntax (Toggle Plain Text)
  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.
Reputation Points: 29
Solved Threads: 76
Practically a Master Poster
network18 is offline Offline
616 posts
since Sep 2009

This thread is solved

Either the thread starter or a moderator has marked this thread as solved. You can most likely trust the responses and answers given. There is most likely no reason for any further responses to be posted here. If you have a related question, please start a new thread in this forum instead.

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in PHP Forum Timeline: Update db
Next Thread in PHP Forum Timeline: url mod writing not working properly





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC