feat(cloud): 支持临时文件上传功能

- 使用 crypto 模块替换 md5 模块进行文件哈希计算
- 添加对临时文件上传的支持,当存在 tempFilePath 时使用文件流处理
- 实现临时文件的 MD5 计算和元数据解析功能
- 在上传完成后自动清理临时文件
- 配置服务器端文件上传中间件启用临时文件支持
- 修改上传插件以支持临时文件读取流上传方式
- 增加文件大小获取和验证的兼容性处理
This commit is contained in:
LaoShui
2026-02-18 16:44:19 +08:00
parent 26d55255e0
commit ba7d1a8574
3 changed files with 63 additions and 17 deletions
+5 -4
View File
@@ -183,11 +183,12 @@ async function consturctServer(moduleDefs) {
app.use(fileUpload({
limits: {
fileSize: 500 * 1024 * 1024 // 500MB
fileSize: 500 * 1024 * 1024
},
useTempFiles: false,
tempFileDir: '/tmp/',
abortOnLimit: true
useTempFiles: true,
tempFileDir: require('os').tmpdir(),
abortOnLimit: true,
parseNested: true
}))
/**