Download files with JSP

Discussions

Web tier: servlets, JSP, Web frameworks: Download files with JSP

  1. Download files with JSP (4 messages)

    Hi! I want to download files from a server using JSP. I managed to do it only with txt files, but I would like to be able to download any kind of file. Can you please help me? Thanks.
    PS Maybe this is not a JSP but a J2SE question. But I thought there might be some JSP feature that can help.

    Threaded Messages (4)

  2. Download files with JSP[ Go to top ]

    You can download any file by giving a link to the resource (file). I don't see any reason why the download shouldn't work for other file types if it works for text files.
  3. Download files with JSP[ Go to top ]

    Try the following to write the output to an excel sheet..
    response.setContentType("application/vnd.ms-excel");
    similarly you can write the output to word and other formats.
  4. Download files with JSP[ Go to top ]

    You should also check out the getMimeType() function in javax.servlet.ServletContext
  5. Download files with JSP[ Go to top ]

    GetMimeType didn't work for me when using JRun 3.x.