<?php
  
    $folder_type = $_GET["type"];
    
    $file_path = "";
    
    if($folder_type==1){
        
    $file_path = "../../uploads/keyterms/";
    
    }else if($folder_type==2){
        
    $file_path = "../../uploads/mindmap/";
    
    }else if($folder_type==3){
        
    $file_path = "../../uploads/keynotes/";
    
    }else if($folder_type==4){
        
    $file_path = "../../uploads/practicalprojects/";
    
    }
  
     
    $file_path = $file_path . basename( $_FILES['uploaded_file']['name']);
    if(move_uploaded_file($_FILES['uploaded_file']['tmp_name'], $file_path)) {
        echo "success";
    } else{
        echo "fail";
    }
 ?>