我正在使用最新版本的
express-fileupload
,没有表格。我打算从邮递员上传图像文件。如何获取上传文件的文件名?
let uploadedFile = req.files.file;
let filename = uploadedFile.name;
let mimeType = uploadedFile.mimetype;
我收到以下错误:
Property 'name' does not exist on type 'UploadedFile | UploadedFile[]'.
Property 'name' does not exist on type 'UploadedFile[]'.ts(2339)
抛弃
express-fileupload
,换取multer
。它工作完美!