I am using https://www.npmjs.com/package/multer library and my node.js app is written in typescript.
I get the following typescript error in my code.
Property 'file' does not exist on type 'Request'.ts(2339)
public document = async (req: Request, res: Response): Promise<any> => {
const documentFile = req.file;
}
How can i resolve this. The req is the express Request object but multers middleware appends a .file into this request object. However it is not aware of this because the types request interface does not originally contain a file properly
const documentFile = (req as any).file;
– Interdenominational