| | |
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: 161
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: 557
Reputation:
Solved Threads: 64
0
#2 Nov 4th, 2009
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: 161
Reputation:
Solved Threads: 6
0
#3 Nov 4th, 2009
•
•
•
•
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: 557
Reputation:
Solved Threads: 64
0
#4 Nov 4th, 2009
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: 161
Reputation:
Solved Threads: 6
0
#6 Nov 4th, 2009
•
•
•
•
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: 557
Reputation:
Solved Threads: 64
"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: 161
Reputation:
Solved Threads: 6
0
#8 Nov 4th, 2009
•
•
•
•
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: 557
Reputation:
Solved Threads: 64
0
#9 Nov 4th, 2009
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: 161
Reputation:
Solved Threads: 6
0
#10 Nov 4th, 2009
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; Nov 4th, 2009 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
Views: 1571 | Replies: 39
| Thread Tools | Search this Thread |
Tag cloud for PHP
.htaccess access ajax apache api array beginner binary broken cakephp checkbox class cms code cron curl customizableitems database date development directory display download dynamic echo email error file files folder form forms forum function functions google headmethod href htaccess html image include insert integration ip java javascript joomla jquery limit link login loop mail malfunctioning menu methods mlm mod_rewrite multiple mysql oop parse paypal pdf php problem query radio random recursion regex remote script search select server sessions sms soap source space speed sql structure syntax system table tutorial update updates upload url validation validator variable video web xml youtube





