Location: PHPKode > scripts > upload.inc.php > upload-inc-php/example.php
<?php

	include_once("upload.inc.php");

	if(isset($_POST['submit']))
	{
		$myUploadobj = new UPLOAD; //creating instance of file.
		$upload_dir="images";
		echo "<br>";
		// use function to upload file.
		$file=$myUploadobj->upload_file($upload_dir,'file',true,true,0,"jpg|jpeg|gif"); 
		if($file==false)
			echo $myUploadobj->error;
		else
			echo "File Name : ".$file;	
		echo "<br>";
	}

?>
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style>
a {  font-family: Verdana, Arial, Helvetica, sans-serif; font-weight: bold; color: #008080; text-decoration: none; font-size: 12px;}
</style>
</head>

<body bgcolor="#FFFFFF" text="#000000">
<form name="test" method="POST" action="" enctype="multipart/form-data">
<input type="FILE" name="file">
  <input type="SUBMIT" name="submit" value="submit">
</form>
</body>
</html>
Return current item: upload.inc.php