A secure, efficient, and feature-rich image upload service with optional content moderation capabilities.
-
Secure Upload System
- File type and size validation
- Automatic file extension detection
- Secure file naming and storage
- Protection against malicious files
-
Content Moderation
- Optional Baidu AI content moderation
- Configurable during installation
- Automatic detection of inappropriate content
- Separate storage for non-compliant images
-
Flexible Configuration
- Easy installation process
- Customizable file size limits
- Configurable storage locations
- Adjustable security settings
-
Robust Error Handling
- Detailed error logging
- User-friendly error messages
- Complete audit trail
- Debug mode for development
- PHP 7.4 or higher
- MySQL 5.7 or higher
- Apache/Nginx web server
- Write permissions for storage directories
- Baidu AI API credentials (optional)
- Download and Upload
- Download the latest release from GitHub
- Upload all files to your web server
- Web Installation
- Visit
http://your-domain/install.phpin your browser - Follow the simple installation wizard:
- System Check: Automatically checks PHP version and required extensions
- Directory Permissions: Verifies and sets required permissions
- Database Setup: Enter your database details
- Content Moderation: Choose whether to enable Baidu content moderation
- Complete: Installation finished!
That's it! Your image upload service is ready to use.
return [
'upload_dir' => '/path/to/uploads',
'max_file_size' => 10485760, // 10MB
'allowed_types' => ['image/jpeg', 'image/png', 'image/gif']
];return [
'enabled' => true,
'client_id' => 'your_api_key',
'client_secret' => 'your_secret_key'
];-
File Validation
- MIME type checking
- File size limits
- Image integrity verification
- Extension validation
-
Content Safety
- Optional AI-powered content moderation
- Automatic flagging of inappropriate content
- Secure storage of non-compliant images
-
System Security
- SQL injection prevention
- XSS protection
- CSRF tokens
- Secure file naming
Contributions are welcome! Please feel free to submit a Pull Request.
一个安全、高效、功能丰富的图片上传服务,支持可选的内容审核功能。
-
安全的上传系统
- 文件类型和大小验证
- 自动文件扩展名检测
- 安全的文件命名和存储
- 恶意文件防护
-
内容审核
- 可选的百度AI内容审核
- 安装时可配置
- 自动检测不当内容
- 违规图片独立存储
-
灵活配置
- 简单的安装过程
- 可自定义文件大小限制
- 可配置存储位置
- 可调整安全设置
-
强大的错误处理
- 详细的错误日志
- 友好的错误提示
- 完整的审计跟踪
- 开发调试模式
- PHP 7.4 或更高版本
- MySQL 5.7 或更高版本
- Apache/Nginx 网络服务器
- 存储目录的写入权限
- 百度AI API凭证(可选)
- 下载并上传
- 从 GitHub 下载最新版本或者使用git clone下载文件
- 将所有文件上传到您的网站服务器解压到相关目录
- 设置运行目录为public
- 创建好数据库
- 网页安装
- 在浏览器中访问
http://your-domain/install.php - 按照安装向导的提示操作:
- 系统检查:自动检查 PHP 版本和必需扩展
- 目录权限:验证并设置所需权限
- 数据库配置:输入数据库信息
- 内容审核:选择是否启用百度内容审核
- 完成安装:安装完成!
就这么简单!您的图片上传服务已经可以使用了。
return [
'upload_dir' => '/path/to/uploads',
'max_file_size' => 10485760, // 10MB
'allowed_types' => ['image/jpeg', 'image/png', 'image/gif']
];return [
'enabled' => true,
'client_id' => 'your_api_key',
'client_secret' => 'your_secret_key'
];-
文件验证
- MIME 类型检查
- 文件大小限制
- 图片完整性验证
- 扩展名验证
-
内容安全
- 可选的 AI 驱动内容审核
- 自动标记不当内容
- 违规图片安全存储
-
系统安全
- SQL 注入防护
- XSS 防护
- CSRF 令牌
- 安全的文件命名
欢迎提交 Pull Request 来帮助改进这个项目!
本项目采用 MIT 协议 - 详见 LICENSE 文件
