You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
import{FileArray,UploadedFile}from'express-fileupload'constreqFile=(req.filesasFileArray).fileasUploadedFileif(!reqFile)throw'No file to upload'// do something
Conversion of type '{ [fieldname: string]: File[]; } | File[]' to type 'FileArray' may be a mistake because neither type sufficiently overlaps with the other. If this was intentional, convert the expression to 'unknown' first.
Type 'File[]' is not comparable to type 'FileArray'.
Index signature for type 'string' is missing in type 'File[]'.ts(2352)
(property) Express.Request.files?: {
[fieldname: string]: Express.Multer.File[];
} | Express.Multer.File[]
Quickfix for this is : const fileArray = (req.files as unknown as FileArray)
How to fix this ? i'm using typescript
The text was updated successfully, but these errors were encountered: