Location: PHPKode > scripts > PHP Simple Upload > php-simple-upload/index.php
<?

define(MAX_FILE_SIZE, 1000000);

include "CLS_UPLOAD.php";
include "CLS_DOWNLOADS.php";

$err = '';




if(isset($_REQUEST['submit'])) {
	$postname = 'upload';
	$uploaddir = 'uploads';
	$validext = array("application/msword", "application/vnd.openxmlformats-officedocument.wordprocessingml.document","image/gif","image/pjpeg", "image/jpg","image/jpeg", "image/png");
	$newupload = new CLS_UPLOAD($postname, $uploaddir, '', $validext); //default accepted file extension is file, unless image is specified
	if($res = $newupload->setUpload()) {$fileup = $newupload->getNewFileN(); $newupload->converttohtml(); }
}

?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>

<body>
<?=(isset($newupload->errmsg)?$newupload->errmsg:"")?>
<form method="post" enctype="multipart/form-data" >
<input type="hidden" name="MAX_FILE_SIZE" value="<?=MAX_FILE_SIZE?>"  />
<input type="file" name="upload"  />
<input type="submit" name="submit" value="submit"  />
</form>
 </body>
</html>
Return current item: PHP Simple Upload