OpenCut-app / OpenCut-app/OpenCut
[FEATURE] File Size Validation
未关闭
还没有人认领这个 Issue。
enhancement
- 主要语言
- TypeScript
- 星标
- 89.8k
- 派生
- 8.9k
- PR 合并指标
- 30 天内没有已合并 PR
描述
Problem
No validation for file sizes before uploading. Large files can cause browser crashes or storage issues.
Users can accidentally upload huge files, causing performance problems.
Solution
Pre-upload Validation with Hard Limits
- Validate file size before processing starts
- Reject files exceeding configured limits immediately
- Show clear error messages with file size info
- Different limits for images, videos, and audio
- Pros: Simple, prevents issues early
- Cons: May be too restrictive for some use cases
Alternative
Approach 1: Soft Limits with Warnings
- Allow uploads but show warnings for large files
- Provide "Continue anyway" option
- Track large files separately
- Pros: Flexible, user-friendly
- Cons: Users might ignore warnings
Approach 2: Progressive Upload with Chunking
- Split large files into chunks
- Upload chunks progressively
- Validate chunk size
- Pros: Handles very large files, better UX
- Cons: Complex implementation, requires chunking logic
Implementation Details:
- Add file size limits (configurable, with sensible defaults)
- Images: 50MB default, configurable up to 200MB
- Videos: 500MB default, configurable up to 2GB
- Audio: 100MB default, configurable up to 500MB
- Show warnings for large files with file size info
- Provide file size information in media panel (already have
file.size) - Option to compress images before adding (using browser-image-compression or similar)
- Check available quota using
navigator.storage.estimate() - Display storage usage indicator
Anything else?
No response
贡献指南
这个仓库没有索引到贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
调研方向
首先定位媒体面板以及现有的 file.size 使用位置。确定哪些验证方式和文件类型限制属于范围之内,然后确定警告、配额检查、压缩或分块应如何交互。Done 应包括可配置的限制、清晰的大小相关反馈,以及对过大上传的明确行为定义。
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- typescript
- 领域
- frontend
- Issue 类型
- 功能
- 难度
- 5/5
- 预计耗时
- 一周以上
- 活跃度
- 停滞
- 描述清晰度
- 需要澄清
- 新手友好度
- 25/100