I have shown the practical working of file downloading of any type whether Doc, Docx, txt, PDF, JPEG, etc. I have changed some lines of Code in The FileDownloadController class like attachment and inline inside format method. Earlier 404 error was coming so I added @Componentscan annotation in the Springboot Application Main class.