Tinyfilemanager 2.4.3 -
// Allowed extensions (empty = all) $allowed_extensions = array( 'jpg','jpeg','png','gif','pdf','txt','doc','docx','xls','xlsx', 'zip','tar','gz','mp3','mp4','php','html','css','js' );
// Enable/disable authentication $use_auth = true;
if ($full_path === false || strpos($full_path, $root_path) !== 0) $full_path = $root_path; $current_path = ''; tinyfilemanager 2.4.3
// Root path for file manager $root_path = $_SERVER['DOCUMENT_ROOT'];
if ($action === 'upload' && isset($_FILES['file'])) $dest = $full_path . '/' . basename($_FILES['file']['name']); if (move_uploaded_file($_FILES['file']['tmp_name'], $dest)) echo "OK"; // Allowed extensions (empty = all) $allowed_extensions =
<?php if (!$readonly): ?> <div class="upload-area"> <form method="post" enctype="multipart/form-data" id="uploadForm"> <input type="file" name="file" id="fileInput"> <button type="submit">Upload</button> </form> <form method="post" style="margin-top: 10px;"> <input type="hidden" name="action" value="mkdir"> <input type="text" name="name" placeholder="New folder name" required> <button type="submit">Create Folder</button> </form> </div> <?php endif; ?>
// ============================================= // DO NOT EDIT BELOW UNLESS YOU KNOW WHAT YOU DO // ============================================= // Enable/disable authentication $use_auth = true
return true;
// Read-only users $read_only_users = array('user');
// Simple auth check function auth($users, $read_only_users = array()) if (!isset($_SESSION['loggedin'])) if (isset($_SERVER['PHP_AUTH_USER']) && isset($users[$_SERVER['PHP_AUTH_USER']])) $pass = $_SERVER['PHP_AUTH_PW']; $hash = $users[$_SERVER['PHP_AUTH_USER']]; if (password_verify($pass, $hash)) $_SESSION['loggedin'] = $_SERVER['PHP_AUTH_USER']; $_SESSION['readonly'] = in_array($_SERVER['PHP_AUTH_USER'], $read_only_users); return true;