<?php

 function getext($img){

  $name = strtolower($img);

  $data = explode(".", $name);

  $ext = count($data) -1;

  return $data[$ext];

 }

	if(isset($_FILES))

	{   



				$name = $_FILES['file1']['name'];

				if(move_uploaded_file($_FILES['file1']['tmp_name'], 'import/'.$name))

				{

					echo '<a href="import/'.$name.'">'.$name.'</a>';

				}

				else

				{

					echo "file upload has an error";

				}



		/*

		$allowed = array('jpeg','jpg','png','gif');

		$ext = getext($_FILES['file1']['name']);

		$size = $_FILES['file1']['size'];

		if(in_array($ext, $allowed))

		{

			if($size < 2097152)

			{

				$name = $_FILES['file1']['name'];

				if(move_uploaded_file($_FILES['file1']['tmp_name'], 'import/'.$name))

				{

					echo '<a href="import/'.$name.'">'.$name.'</a>';

				}

				else

				{

					echo "file upload has an error";

				}

			}

			

			else

			{

				echo "File size more than <strong>2MB<strong>";

			}

		}

		

		else

		{

			echo "file type not allowed";

		}

		*/

	}

	

	else

	{

		echo "not";

	}

?>