Location: PHPKode > scripts > File Upload > file-upload/uploaddemo.php
<?php
include('i_upload.cls.php');
?>
<html>
<body>
<?php
if($_FILES['userfile']['name']!=''){
	$file = new FileUpload();
	$file->SetFileType(".jpg");
	echo "Allowable File Types: " . $file->GetFileTypes() . "<br>";
	$file->SetBadFileType(".png");
	echo "Unacceptable File Types: " . $file->GetBadFileTypes() . "<br>";
	$file->SetMaxFileSize("1000");
	$file->UploadFile("userfile", "", "Test");
	echo "FileSize: " . $file->GetFileSize() . "<br>";
	echo "Extension: " . $file->GetExtension() . "<br>";
	echo "Filename: " . $file->GetFilename() . "<br>";
	echo "Error: " . $file->GetError() . "<br>";
}
?>
<form enctype="multipart/form-data" action="i_upload.php" method="post">
	Choose a file to upload: <input name="userfile" type="file"><br>
	<input type="submit" value="Upload File">&nbsp;&nbsp;<input type="button" value="Cancel" OnClick="Reset();">
</form>
</body>
</html>
Return current item: File Upload