<?php

			session_start();

			$fileName = $_FILES["file1"]["name"]; 			// The file name
			$fileTmpLoc = $_FILES["file1"]["tmp_name"]; 	// File in the PHP tmp folder
			$fileType = $_FILES["file1"]["type"]; 			// The type of file it is
			$fileSize = $_FILES["file1"]["size"]; 			// File size in bytes
			$fileErrorMsg = $_FILES["file1"]["error"]; 		// 0 for false... and 1 for true
			
			if (!$fileTmpLoc) 
			{ 
				echo "ERREUR: Aucun fichier selectionner !.";
				exit();
			}

			if(move_uploaded_file($fileTmpLoc, "temp_upload/$fileName"))
			{
				$_SESSION['upload_fichier'] = $fileName;

				/*if(!file_exists('upload/' .$fileName ) )
				{
					copy("temp_upload/" .$fileName, "upload/" .$fileName);
					unlink("temp_upload/" .$fileName);
				}*/
				
			} 
			else 
			{
				echo "Erreur lors du transfert ?.";
			}
?>