<?
	if($_POST["accion"] =="subir"){
		$fullpath = utf8_decode($_POST["carpetaremota"]);      
      	$fullpath .= utf8_decode($_POST["nombrearchivo"]);

		
		if(move_uploaded_file($_FILES['Filedata']['tmp_name'], $fullpath))
			echo "OK";		
		else 
			echo "ERROR";
	}
	
	if($_POST["accion"] =="confirmar"){
		$fullpathO = utf8_decode($_POST["origen"]);      
      	$fullpathD = utf8_decode($_POST["destino"]);
		if (copy($fullpathO, $fullpathD))		
		{
			echo "OK";
			@unlink($fullpathO);
		}else 
		  
			echo "ERROR";
			
	}
	if($_POST["accion"] =="eliminar"){
		$fullpath = utf8_decode($_POST["archivo"]);            	
		if (@unlink($fullpath))		
			echo "OK";
		 else
			echo "ERROR";
			
	}	
	
	if($_POST["accion"] =="existe"){
		$fullpath = utf8_decode($_POST["archivo"]);            	
		if (@file_exists($fullpath))		
			echo "OK";
		 else
			echo "ERROR";
			
	}		
?>