Hi.
I would like to develop a Java servlet which sends a file in response. The final goal is to view the downloaded file on the Web browser.
I know this could be done in HTTP, but if someone can tell me, it would be great.
Sorry palbano, I was not very explicit, but I do not want to send a HTML file, it could be a Word file, or PDF, anykind of file. I have found a way to perform this, I set the content-type to the type of the file and copy the file in the response (ServletOutputStream). Maybe there exist a way to set the good MIME type with the good file type directly. I don't know.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.