Results 1 to 5 of 5

Thread: how to validate video file type?

Threaded View

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Jul 2005
    Posts
    840

    Resolved how to validate video file type?

    here is my php file for upload the video file...........how to write the validation of video file type? like if the file type is img, or not the .wmv, .rmvb.............as well as how to validate the file size??
    Code:
    <?php
         if (!is_uploaded_file($_FILES['uploadfile']['tmp_name'])){
    	echo "you did not upload a file";
    	unlink($_FILES['uploadfile']['tmp_name']);
         
         } else {
    		$target_path = "VideoUploadFolder/";
    
    		$target_path = $target_path.basename($_FILES['uploadfile']['name']);
    
    		if (move_uploaded_file($_FILES['uploadfile']['tmp_name'], $target_path)){
    			
    			echo "the file ".basename($_FILES['uploadfile']['name']). " has been uploaded";
    			
    		} else{
    			echo "there was an error uploading the file, please tryagain!";
    		}
    		
         }
    ?>
    Last edited by kenny_oh; Dec 2nd, 2005 at 07:27 PM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width