File "upload.php"

Full Path: /home/analogde/www/Prog/File explorer/010/upload.php
File size: 750 bytes
MIME-type: text/x-php
Charset: utf-8

<?php 
session_start();
if(($_FILES["file"]["size"] < 2000000)){
	if ($_FILES["file"]["error"] > 0){
    	$errMsg='Return Code: " . $_FILES["file"]["error"] . "';
    	echo("<script>alert('$errMsg')</script>");
    }
    else{
    	if (file_exists($_SESSION['path'] .'/'. $_FILES["file"]["name"])){
	      		$errMsg=$_FILES["file"]["name"] . ' already exists. ';
	      		echo("<script>alert('$errMsg')</script>");
	      }
	    else{
	      	move_uploaded_file($_FILES["file"]["tmp_name"],$_SESSION['path'] .'/'. $_FILES["file"]["name"]);
	      	echo("<script>alert('Upload successfully')</script>");
	      }
    }
    header( "HTTP/1.1 301 Moved Permanently" );
	header( "Location: index.php?path=". $_SESSION['path']);
}
?>