| | |
Mp3 file upload problem
Please support our PHP advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
Thread Solved |
•
•
Join Date: Aug 2008
Posts: 149
Reputation:
Solved Threads: 6
Hi frnds...
i m trying to upload mp3 file ..this is my code..
it displays no error...but, no output.
can any body give me some suggestion plz...
Thanks in advance...
Sari K
i m trying to upload mp3 file ..this is my code..
•
•
•
•
upload_max_filesize = 20M;//in php.ini
PHP Syntax (Toggle Plain Text)
$tname = $_FILES["tphoto"]["name"]; $ttmp_name = $_FILES["tphoto"]["tmp_name"]; //Audio File Uploading.... if($_FILES['tphoto']['type'] == 'audio/mpeg'){ $dir="../../music/$aid"; move_uploaded_file($ttmp_name,"$dir"."/"."$tname"); }
it displays no error...but, no output.
can any body give me some suggestion plz...
Thanks in advance...
Sari K
My best wishes ... from my soul ... for everyone!
Keep Smiling....Never Depress
Keep Smiling....Never Depress
•
•
Join Date: Sep 2009
Posts: 527
Reputation:
Solved Threads: 61
0
#2 28 Days Ago
check if this is in your form -
enctype="multipart/form-data"
enctype="multipart/form-data"
"The discipline of writing something down is the first step towards making it happen."
follow me on twitter
follow me on twitter
•
•
Join Date: Aug 2008
Posts: 149
Reputation:
Solved Threads: 6
0
#3 28 Days Ago
•
•
•
•
check if this is in your form -
enctype="multipart/form-data"
Hi ,
Thanks 4 ur reply...
it works fine for all (images, WMA)....when i change the below code..
PHP Syntax (Toggle Plain Text)
$_FILES['tphoto']['type'] == 'audio/wma'
prob only for MP3 files...
My best wishes ... from my soul ... for everyone!
Keep Smiling....Never Depress
Keep Smiling....Never Depress
•
•
Join Date: Sep 2009
Posts: 527
Reputation:
Solved Threads: 61
0
#4 28 Days Ago
if you check against that type only, its obvious that script will allow only that file type.
Maybe you are looking for "audio/x-mpeg-3" as file type.
Maybe you are looking for "audio/x-mpeg-3" as file type.
"The discipline of writing something down is the first step towards making it happen."
follow me on twitter
follow me on twitter
•
•
Join Date: Aug 2008
Posts: 149
Reputation:
Solved Threads: 6
0
#6 28 Days Ago
•
•
•
•
if you check against that type only, its obvious that script will allow only that file type.
Maybe you are looking for "audio/x-mpeg-3" as file type.
hi
•
•
•
•
file type= "MP3 formate sound";
i need to allow only MP3 FILES.....
Is there any other parameters change in PHP.INI??...
My best wishes ... from my soul ... for everyone!
Keep Smiling....Never Depress
Keep Smiling....Never Depress
•
•
Join Date: Sep 2009
Posts: 527
Reputation:
Solved Threads: 61
"The discipline of writing something down is the first step towards making it happen."
follow me on twitter
follow me on twitter
•
•
Join Date: Aug 2008
Posts: 149
Reputation:
Solved Threads: 6
0
#8 28 Days Ago
•
•
•
•
then why you not using straightaway
$_FILES["file"]["type"] == "audio/mp3";
Hi ..
I m sorry....
when i m write the if condition..its not working for all types..
PHP Syntax (Toggle Plain Text)
if (($_FILES["tphoto"]["type"] == "audio/wma")){
with out condition it works fine except for MP3....
My best wishes ... from my soul ... for everyone!
Keep Smiling....Never Depress
Keep Smiling....Never Depress
•
•
Join Date: Sep 2009
Posts: 527
Reputation:
Solved Threads: 61
0
#9 28 Days Ago
By using this "if loop " , you actually what is the file type, and if the file type is the specified one then allow the process else do something else.
I think why to use it, must be clear to you by this now.
And you saying when you not using this if loop you are able to upload all the files except the MP3, maybe with this MP3 file you are violating the file size limit.
echo your file element and post it's contents here with this file
I think why to use it, must be clear to you by this now.
And you saying when you not using this if loop you are able to upload all the files except the MP3, maybe with this MP3 file you are violating the file size limit.
echo your file element and post it's contents here with this file
"The discipline of writing something down is the first step towards making it happen."
follow me on twitter
follow me on twitter
•
•
Join Date: Aug 2008
Posts: 149
Reputation:
Solved Threads: 6
0
#10 28 Days Ago
Hi ..
now i m trying for 5 mb MP3 file...its uploaded perfectly....So, the prob with file size...but in my php.ini
plz tell me wat i have to do...
Thanks a lot..
now i m trying for 5 mb MP3 file...its uploaded perfectly....So, the prob with file size...but in my php.ini
•
•
•
•
upload_max_size=20M
Thanks a lot..
Last edited by sarithak; 28 Days Ago at 3:51 am.
My best wishes ... from my soul ... for everyone!
Keep Smiling....Never Depress
Keep Smiling....Never Depress
![]() |
Similar Threads
- problem with the file upload dialog (C#)
- File upload problem (PHP)
- File Upload Servlet problem (JSP)
- file upload script for music files and video files (PHP)
- File upload - advanced help (PHP)
- file upload code.....need attention (PHP)
- File upload problem (PHP)
Other Threads in the PHP Forum
- Previous Thread: Google pagerank and alexa php style stats on domain pages..
- Next Thread: radiobutton with textarea
| Thread Tools | Search this Thread |
apache api array beginner binary body broken buttons cakephp checkbox class cms code cron curl database date date/time display dynamic ebooks echo email error file files folder form forms function functions global google href htaccess html image include insert ip javascript joomla limit link list login mail mediawiki menu mlm msqli_multi_query multiple mycodeisbad mysql number oop parameter paypal pdf php phpincludeissue phpmyadmin problem query radio random recursion regex remote script search seo server sessions sms source sp space speed sql static subdomain syntax system table tag tutorial update upload url validator variable vbulletin video web webdesign white wordpress xml youtube





