joecooper Posted April 18, 2006 Share Posted April 18, 2006 if ($_FILES['userfile']['type'] == 'wmv' or 'mpg' or 'mpeg' or 'avi'){how can i make that work? Thanks Quote Link to comment Share on other sites More sharing options...
magnav0x Posted April 18, 2006 Share Posted April 18, 2006 [!--quoteo(post=366101:date=Apr 18 2006, 12:58 PM:name=joecooper)--][div class=\'quotetop\']QUOTE(joecooper @ Apr 18 2006, 12:58 PM) [snapback]366101[/snapback][/div][div class=\'quotemain\'][!--quotec--]if ($_FILES['userfile']['type'] == 'wmv' or 'mpg' or 'mpeg' or 'avi'){how can i make that work? Thanks[/quote]Something like:if ($_FILES['userfile']['type'] == 'video/x-ms-wmv ' || $_FILES['userfile']['type'] == 'video/mpeg' || $_FILES['userfile']['type'] == 'video/x-msvideo'){video/mpeg will handle MPG and MPEG. video/x-msvideo will handle AVIvideo/x-ms-wmv will handle WMV (not sure about this one)I'm not positive on the WMV one, but it may be right. You need to know the mime types associated with the files you are comparing against. Quote Link to comment Share on other sites More sharing options...
Barand Posted April 18, 2006 Share Posted April 18, 2006 alternatively[code]$goodType = array ('video/x-ms-wmv ','video/mpeg','video/x-msvideo');if (in_array($_FILES['userfile']['type'], $goodType)) { # process file}[/code] Quote Link to comment Share on other sites More sharing options...
inztinkt Posted April 18, 2006 Share Posted April 18, 2006 Once again, Barand you've tawt me somethin new, didnt knw u culd check arrays like tht. thanks :) Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.