<?php 
$filename = $_FILES['file']['name']; 
$path_parts = pathinfo($filename);
$ext=$path_parts['extension'];
$path= "../output/wsfiles/".$_REQUEST['clientnumber'];
$location = "../output/wsfiles/".$_REQUEST['clientnumber']."/WS".$_REQUEST['wsno'].".".$ext; 
$uploadOk = 1; 
if(!is_dir($path)){mkdir($path);}
if($uploadOk == 0){echo 0;}
else{ 
if(move_uploaded_file($_FILES['file']['tmp_name'], $location)){ 
echo "s";
}
else{echo 0;} 
} 
?> 