<?php
 
	if($_SERVER['REQUEST_METHOD']=='POST'){
		$file_name = $_FILES['myFile']['name'];
		$file_size = $_FILES['myFile']['size'];
		$file_type = $_FILES['myFile']['type'];
		$temp_name = $_FILES['myFile']['tmp_name'];
				
		$location = "ChatApp/ChatVideos/";
		
		if (!file_exists($location)) {
            mkdir($location, 0777, true);
      }
			
		move_uploaded_file($temp_name, $location.$file_name);
		echo "VideoUpload/uploads/".$file_name;
	}else{
		echo "Error";
	}