<?php
session_start();
 
$command=$_GET['c'];
$filename=$_GET['file'];
$folder="/uploads";

$filename=str_replace("%2F","/",$filename);

if(isset($_SESSION['FTP_FOLDER'])){
	$NameOfFolder=$_SESSION['FTP_FOLDER'];
	$TargetFolder=$_SESSION[$NameOfFolder];    # ."/".$folder;
}
else{
	$TargetFolder= $folder;
}	
 
$TargetName= "$TargetFolder$filename"; 


//echo "$_SESSION[FTP_FOLDER]=".$_SESSION['FTP_FOLDER']. " url=$url  /n  command=$command /n  filename=$file_name  /n  TargetName=$TargetName";

 if($command=="down") {
 
 } 


 if($command=="delete") {
	 if(file_exists($TargetName)) {
		 unlink($TargetName); 
		 echo "Το αρχείο: $TargetName, διαγράφηκε επιτυχώς. ";
		 } 
}

 if($command=="rmdir") {
	 if(is_dir($TargetFolder)) {rmdir($TargetFolder); } 
}

 if($command=="mkdir") {
	 if(!is_dir($TargetFolder)) {mkdir($TargetFolder); } 
}


echo "$_SESSION[FTP_FOLDER]=".$_SESSION['FTP_FOLDER']. " url=$url  /n  command=$command /n  filename=$file_name  /n  TargetName=$TargetName";

 

//exit();	
	
?>
 
 <script language="JavaScript" type="text/JavaScript">
 
	//  window.history.go(-1);
	//  location.reload(); 
 
</script>
 
  
