| | |
php form upload video files not working
Please support our PHP advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
![]() |
•
•
Join Date: Oct 2009
Posts: 1
Reputation:
Solved Threads: 0
I wish to limit uploading to the video files swf pps bmp pps png gif mpg mp3 and wav - i'm sure I have the file / type incorrect. can someone please give logical solution...
here's my code:
here's my code:
php Syntax (Toggle Plain Text)
<?php if ((($_FILES["file"]["type"] == "video/swf") || ($_FILES["file"]["type"] == "video/pps") || ($_FILES["file"]["type"] == "video/bmp") || ($_FILES["file"]["type"] == "video/pps") || ($_FILES["file"]["type"] == "video/png") || ($_FILES["file"]["type"] == "video/gif") || ($_FILES["file"]["type"] == "video/mp3") || ($_FILES["file"]["type"] == "video/wav")) && ($_FILES["file"]["size"] < 200000)) { if ($_FILES["file"]["error"] > 0) { echo "Return Code: " . $_FILES["file"]["error"] . "<br />"; } else { echo "Upload: " . $_FILES["file"]["name"] . "<br />"; echo "Type: " . $_FILES["file"]["type"] . "<br />"; echo "Size: " . ($_FILES["file"]["size"] / 200000) . " Kb<br />"; echo "Temp file: " . $_FILES["file"]["tmp_name"] . "<br />"; if (file_exists("upload/" . $_FILES["file"]["name"])) { echo $_FILES["file"]["name"] . " already exists. "; } else { move_uploaded_file($_FILES["file"]["tmp_name"], "upload/" . $_FILES["file"]["name"]); echo "Thank you for your" . "upload/" . $_FILES["file"]["name"]; } } } else { echo "Invalid file"; } ?>
Last edited by peter_budo; Oct 17th, 2009 at 2:20 pm. Reason: Keep It Organized - For easy readability, always wrap programming code within posts in [code] (code blocks)
0
#2 Oct 16th, 2009
•
•
•
•
I wish to limit uploading to the video files swf pps bmp pps png gif mpg mp3 and wav>
Only SWF and MPG would qualify. Unless you also count animated images, in which case PNG and GIF would count as well.
But yea, you have the mime types wrong.
You can look up the proper mime types at w3schools.com.
Please do not ask for help in a PM. Use the forums.
And use [code] tags!
And use [code] tags!
![]() |
Similar Threads
- PHP Video upload (PHP)
- Help with PHP Image Upload? (PHP)
- Using AJAX results in PHP form (JavaScript / DHTML / AJAX)
- PHP File upload validation before the file uploads (PHP)
- Php file upload (PHP)
- upload multiple files (PHP)
- Sending pic attachments via PHP form (PHP)
- file upload script for music files and video files (PHP)
Other Threads in the PHP Forum
- Previous Thread: Parse error: syntax error, unexpected T_VARIABLE in /home/content/m/i/x/mixxsalon/htm
- Next Thread: Html-php-sql2005
| Thread Tools | Search this Thread |
access adobe advertising affordable ajax array asp asp.net audio basic bbc bluray botnet broadcast c# cheap checkbox class cms code cpanel css curl data database design development digital display download dvd ego email feedback ffmpeg file files flash form format forms function google hd hosting html image include insert integration internet java javascript joomla limit link linux login mail malware marketing media microsoft multiple mysql news open password paypal pdf php popularity post problem query review script search security seo session sms soap spam sql traffic tv upload validation vbulletin video virus visual web webdevelopment website window xml youtube zend






