Location: PHPKode > projects > SCOP Heartbeat Administration interface > scop-2.0/html/scop/config/recieve_pem.php
<?php
// In PHP versions earlier than 4.1.0, $HTTP_POST_FILES should be used instead
// of $_FILES.
	include ("../inc/header.inc");
include ("../inc/functions.inc");


			$name = $_POST['name'];
			$uploaddir = '/var/www/uploads/';
			$uploadfile = $uploaddir . $_FILES['userfile']['name'];
			$target = "/tmp/$name";
			print "<pre>";
			if (move_uploaded_file($_FILES['userfile']['tmp_name'], $target)) {
			   print "Thanks, the new .pem certificate file has been uploaded to /usr/local/etc/$name. ";
			`sudo mv /usr/local/etc/$name /usr/local/etc/$name.old`;
			`sudo mv /tmp/$name /usr/local/etc/$name`;
			   //print "Here's some more debugging info:\n";
			   //print_r($_FILES);
			} else {
			   print "Possible file upload attack!  Here's some debugging info:\n";
			   print_r($_FILES);
			}
			print "</pre>";
?>
Return current item: SCOP Heartbeat Administration interface