So, I am writing a java servlet. The user goes to the servlet and they automatically are prompted to download or open the excel file. How do I do this? I have the excel file in my webcontent folder. I know it’s pretty elementary, but I’ve always been bad at the file and outputstream and inputstream stuff.
Share
Just link to it directly. The servletcontainer’s builtin default servlet will then worry about the streaming and setting the proper headers.