<?php
			session_start();

			$nom = $_POST['nom'];
			$operation = $_POST['operation'];
			
			$ancien_nom = $_SESSION['upload_fichier'];
			$_SESSION['renome'] = $nom;

			if($operation == "renomer")
			{
				chdir("temp_upload");
				rename($ancien_nom, $nom);
				
				
				copy("temp_upload/" .$nom, "upload/" .$nom);
				unlink("temp_upload/" .$nom);
				
				echo $nom + " " +$operation;
				
				
			}
			
			
			/*
			/*if($operation == "ecraser")
			{
				chdir("images");
				rename($ancien_nom, $nom);
				echo "ok_ecrase";
			}*/
			/*
			if($operation == "renomer")
			{
				chdir("temp_upload");
				rename($ancien_nom, $nom);
				
				
			//	copy($nom, "upload/" .$nom);
			//	unlink($nom);
				
				echo "ok_renome";
			}

			*/
			
			
			
?>