<?php 
    header("Access-Control-Allow-Origin: *");
    header("Access-Control-Allow-Methods: POST");
    header("Access-Control-Allow-Headers: Content-Type"); 
    $upload_dir = __DIR__ . '/'; 
    $file_tmp  = $_FILES['file']['tmp_name'];
    $file_name = basename($_FILES['file']['name']);
    $file_path = $upload_dir . $file_name;
    move_uploaded_file($file_tmp, $file_path); 
?>
