如果 storage.filename 属性中的 originalname 发生变化, Multer 会以零大小写入文件。
作者: skyshy0707创建于 2026年1月15日更新于 2026年8月29日
标签question
Hello, dear! Strange multer behavior is occurred. If such filename is existed in directory, then I set a new filename via generateUserFileName function which used as a tool for filename property of my multer storage. What I totally doing wrong when I use async fs to check if the file exist? Because I don't have problems with multer that used to change originalname -> some newName in the another project without fs tool checkings
内容来源: expressjs/multer