A modern, secure, and feature-rich file management system built with PHP. FileServer provides a web-based interface for file uploads, downloads, sharing, and administration with robust security features and user management.
- File Management: Upload, download, rename, delete, and organize files
- User Authentication: Secure login system with role-based access control
- File Sharing: Share files with customizable permissions and expiration dates
- Search & Filter: Advanced search functionality with multiple filter options
- Bulk Operations: Perform operations on multiple files simultaneously
- File Compression: Create and extract ZIP archives
- File Versioning: Maintain multiple versions of files
- Thumbnail Generation: Automatic thumbnail generation for images
- Access Control: Role-based permissions (Admin, User, Guest)
- IP Blocking: Automatic blocking of suspicious IP addresses
- File Quarantine: Suspicious files are quarantined for manual review
- Session Management: Secure session handling with timeout
- CSRF Protection: Cross-site request forgery protection
- Input Validation: Comprehensive input sanitization and validation
- Secure File Storage: Files stored outside web root with access controls
- User Management: Create, edit, and manage user accounts
- System Monitoring: Real-time system status and performance metrics
- Activity Logging: Comprehensive logging of all system activities
- Backup & Restore: Automated backup system with restoration capabilities
- Configuration Management: Web-based system configuration
- Maintenance Mode: Enable maintenance mode for system updates
- Responsive Design: Mobile-friendly interface that works on all devices
- Theme System: Light, dark, and auto themes with system preference detection
- Drag & Drop: Intuitive drag-and-drop file upload
- Progress Tracking: Real-time upload and operation progress
- Notifications: Toast notifications for user feedback
- Keyboard Shortcuts: Productivity-enhancing keyboard shortcuts
- Context Menus: Right-click context menus for quick actions
- PHP: 7.4 or higher (8.0+ recommended)
- Web Server: Apache with mod_rewrite or Nginx
- Extensions: json, mbstring, fileinfo, zip, gd, curl
json- JSON data handlingmbstring- Multi-byte string supportfileinfo- File type detectionzip- Archive creation and extractiongd- Image processing and thumbnail generationcurl- HTTP requests (optional)
- Writable directories for data storage, logs, and file uploads
- Sufficient disk space for file storage and backups
# Download the FileServer package
# Extract to your web server directory# Set appropriate permissions for data directories
chmod 755 data/ logs/ storage/
chmod 644 data/*.json# Navigate to the FileServer directory in your web browser
# Run the initialization script
http://your-domain.com/path-to-fileserver/init.phpEnsure mod_rewrite is enabled and .htaccess files are processed:
<VirtualHost *:80>
DocumentRoot /path/to/fileserver
ServerName your-domain.com
<Directory /path/to/fileserver>
AllowOverride All
Require all granted
</Directory>
</VirtualHost>server {
listen 80;
server_name your-domain.com;
root /path/to/fileserver;
index index.php;
location / {
try_files $uri $uri/ /index.php?$query_string;
}
location ~ \\.php$ {
fastcgi_pass unix:/var/run/php/php8.0-fpm.sock;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
location ~* \\.(json|log|ini)$ {
deny all;
}
}- Access the web interface at your configured URL
- Log in with default credentials:
admin/admin123 - Change the default admin password immediately
- Configure system settings via the admin panel
The system can be configured through:
- Web Interface: Admin panel → Settings
- Configuration File:
data/config.json - PHP Configuration:
includes/config.php
- File Upload Limits: Maximum file size and allowed extensions
- User Registration: Enable/disable user registration
- File Sharing: Configure sharing permissions and expiration
- Security Settings: Failed login attempts, lockout duration
- Backup Settings: Automatic backup scheduling
- Theme Settings: Default theme and customization options
- Login: Access the system with your credentials
- Upload Files: Drag and drop or use the upload button
- Browse Files: Navigate through your files and folders
- Share Files: Create shareable links with permissions
- Search: Use the advanced search to find files quickly
- Download: Download individual files or bulk selections
- User Management: Create and manage user accounts
- System Monitoring: Monitor system health and performance
- File Management: Manage all files across the system
- Security: Review logs and manage security settings
- Backups: Schedule and manage system backups
- Configuration: Adjust system settings and preferences
FileServer/
├── index.php # Main entry point
├── login.php # User login page
├── register.php # User registration page
├── dashboard.php # User dashboard
├── file-browser.php # File browser interface
├── upload.php # File upload interface
├── search.php # Search interface
├── admin.php # Admin panel
├── settings.php # User settings
├── error.php # Error page handler
├── init.php # System initialization
├── .htaccess # Apache configuration
├── api/ # API endpoints
│ ├── auth.php # Authentication API
│ ├── files.php # File operations API
│ ├── users.php # User management API
│ ├── upload.php # Upload API
│ ├── share.php # Sharing API
│ ├── compress.php # Compression API
│ └── backup.php # Backup API
├── assets/ # Static assets
│ ├── css/ # Stylesheets
│ │ ├── main.css # Main styles
│ │ ├── admin.css # Admin panel styles
│ │ ├── forms.css # Form styles
│ │ ├── file-browser.css # File browser styles
│ │ ├── mobile.css # Mobile responsive styles
│ │ └── themes.css # Theme system styles
│ └── js/ # JavaScript files
│ ├── main.js # Core JavaScript framework
│ ├── file-browser.js # File browser functionality
│ ├── upload.js # Upload functionality
│ ├── admin.js # Admin panel functionality
│ ├── search.js # Search functionality
│ ├── theme-toggle.js # Theme management
│ └── bulk-operations.js # Bulk operations
├── includes/ # PHP includes
│ ├── config.php # Configuration
│ ├── functions.php # Core functions
│ ├── auth-functions.php # Authentication functions
│ ├── file-functions.php # File handling functions
│ ├── user-functions.php # User management functions
│ ├── json-functions.php # JSON data functions
│ ├── log-functions.php # Logging functions
│ ├── security-functions.php # Security functions
│ └── validation-functions.php # Input validation
├── templates/ # HTML templates
│ ├── header.html # Page header
│ ├── footer.html # Page footer
│ ├── navigation.html # Navigation menu
│ ├── login-form.html # Login form
│ ├── register-form.html # Registration form
│ ├── upload-form.html # Upload form
│ ├── search-form.html # Search form
│ ├── file-list.html # File listing
│ └── user-list.html # User listing
├── data/ # Data storage (JSON files)
│ ├── users.json # User data
│ ├── files.json # File metadata
│ ├── shares.json # Share configurations
│ ├── logs.json # System logs
│ ├── config.json # System configuration
│ ├── blocked-ips.json # Blocked IP addresses
│ ├── backups/ # System backups
│ └── locks/ # File locks
├── storage/ # File storage
│ ├── uploads/ # User uploaded files
│ ├── compressed/ # Compressed archives
│ ├── quarantine/ # Quarantined files
│ ├── thumbnails/ # Generated thumbnails
│ └── versions/ # File versions
└── logs/ # System logs
- File type validation based on MIME type and extension
- File size limits to prevent resource exhaustion
- Quarantine system for suspicious files
- Virus scanning integration (optional)
- Session-based authentication with secure cookies
- Role-based access control (RBAC)
- IP-based access restrictions
- Failed login attempt tracking and lockout
- Files stored outside web root when possible
- Encrypted file storage options
- Secure file sharing with expiration dates
- Regular security audits and updates
All API endpoints require authentication via session cookies or API tokens.
GET /api/files.php- List filesPOST /api/files.php- Create file/folderPUT /api/files.php- Update file metadataDELETE /api/files.php- Delete files
POST /api/upload.php- Upload files (supports chunked upload)
GET /api/users.php- List users (admin only)POST /api/users.php- Create user (admin only)PUT /api/users.php- Update userDELETE /api/users.php- Delete user (admin only)
POST /api/share.php- Create share linkGET /api/share.php- Get share informationDELETE /api/share.php- Remove share
- Check PHP
upload_max_filesizeandpost_max_sizesettings - Verify directory permissions for storage folders
- Ensure sufficient disk space
- Enable PHP opcache for better performance
- Optimize database queries and file operations
- Consider using a CDN for static assets
- Update PHP to the latest version
- Review and update .htaccess rules
- Monitor failed login attempts
- Clear browser cache after theme changes
- Check CSS file permissions
- Verify theme file syntax
Enable debug mode in includes/config.php for detailed error information:
$config['debug'] = true;Check system logs for detailed error information:
logs/system.log- General system logslogs/error.log- Error logslogs/security.log- Security-related logs
- Clone the repository
- Set up a local web server (Apache/Nginx)
- Configure PHP with required extensions
- Run initialization script
- Start developing
- Follow PSR-12 coding standards for PHP
- Use meaningful variable and function names
- Add comments for complex logic
- Maintain security best practices
- Test all functionality across different browsers
- Verify mobile responsiveness
- Test with different file types and sizes
- Perform security testing
This project is licensed under the MIT License. See the LICENSE file for details.
For support and questions:
- Check the documentation and troubleshooting section
- Review the issue tracker for known problems
- Contact the development team
- Initial release with core functionality
- User authentication and management
- File upload/download with chunked support
- File sharing and compression
- Admin panel and system monitoring
- Mobile-responsive design
- Theme system with light/dark modes
- Advanced search and bulk operations
- Comprehensive security features
- Automated backup system
FileServer - A comprehensive PHP file management system for modern web applications.