-
Notifications
You must be signed in to change notification settings - Fork 117
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: support custom filename when file is Buffer or Readable (#508)
> Uploading files with Buffer defaults the filename to the key or path, which can conflict with middleware checks. * 🤖 files as an object defaults filename to the key. ~~* 🚨 File paths or streams also override the filename.~~ * ♻️ only work for buffer scence. ---------- > 当直接通过 Buffer 来上传文件时,无法自定义文件名,这在某些中间件会校验 filename,导致无法上传。 * 🤖 files 参数为 object 时,默认将 key 作为文件名传输 ~~* 🚨 传入文件路径或 Readable 流时也同样覆盖~~ * ♻️ 仅处理 buffer 场景 <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit ## Summary by CodeRabbit - **New Features** - Enhanced file upload functionality to support optional custom file names, allowing users to specify filenames when uploading files. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
- Loading branch information
Showing
2 changed files
with
37 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters