How to upload selective files in php??

Discussion in 'PHP' started by asadul, Jul 7, 2009.

  1. #1
    I want 2 upload files with extensions .wma or else. If it is not a video file , it will give an alert.
    :eek:
     
    asadul, Jul 7, 2009 IP
  2. howling-hawk

    howling-hawk Peon

    Messages:
    50
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Check the config.php and please add more details to your post.

    It almost makes no sense.

    -Howlinghawk
     
    howling-hawk, Jul 7, 2009 IP
  3. hassanahmad2

    hassanahmad2 Active Member

    Messages:
    243
    Likes Received:
    9
    Best Answers:
    0
    Trophy Points:
    60
    #3
    I think you are talking about uploading file in php. You can get the extension of the file by using this function:
    
    function getextension ($filename) 
    { 
    	$filename = strtolower($filename) ; 
    	$exts = split("[/\\.]", $filename) ; 
    	$n = count($exts)-1; 
    	$exts = $exts[$n]; 
    	return $exts; 
    }
    
    Code (markup):
    Then you can check whether its mpg or wma etc or not.
     
    hassanahmad2, Jul 7, 2009 IP