Tinyfilemanager 2.4.3 -
<?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; ?>
if ($use_auth) auth($auth_users, $read_only_users); $readonly = $_SESSION['readonly']; else $readonly = false;
// Enable/disable authentication $use_auth = true; tinyfilemanager 2.4.3
if (!$readonly) if ($action === 'mkdir' && isset($_POST['name'])) $newdir = $full_path . '/' . basename($_POST['name']); if (!file_exists($newdir)) mkdir($newdir, 0755);
<?php // TinyFileManager 2.4.3 // https://github.com/prasathmani/tinyfilemanager // Released under MIT License session_name('filemanager'); session_start(); '/' . basename($_POST['file'])
if ($action === 'delete' && isset($_POST['file'])) $target = $full_path . '/' . basename($_POST['file']); if (is_file($target)) unlink($target); if (is_dir($target)) array_map('unlink', glob($target . '/*')) && rmdir($target);
// Upload file size limit (in bytes) $upload_max_size = 50 * 1024 * 1024; // 50MB if (is_file($target)) unlink($target)
if ($full_path === false || strpos($full_path, $root_path) !== 0) $full_path = $root_path; $current_path = '';