This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes JSP and the fly likes file download Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "file download" Watch "file download" New topic

file download

riya s
Ranch Hand

Joined: Feb 28, 2003
Posts: 110
I am developing a file download jsp page. But i am facing problem while
supporting download for different mime types. I have some confusions :
1) When i write file with "application/octet-stream", netscape shows
the save dialog box,and save it as a .exe.jsp file. but we can rename it to the actual type and it works fine. so how to instruct netscape to save the file as "application".
(2) If i write the file with "text/plain" mime type, browser opens the
file, but i want it to save the file, instead of opening it.
3) How can i set the file name in the save dialog of the browser?
thanks in advance
Brian Pipa
Ranch Hand

Joined: Sep 29, 2003
Posts: 299
Take a look at JspBrowser:
It's a free, open-source JSP file browser/downloader. The code inside it is messy (to say the least), but it might have the answer for you. I'm actually working right now on cleaning it up and making the code "prettier" (and adding real MP3 support)

My Java Freeware:<br />MACCC - <a href="" target="_blank" rel="nofollow"></a><br />Nator - <a href="" target="_blank" rel="nofollow"></a>
I agree. Here's the link:
subject: file download
Similar Threads
how to download a file.......
Apache File Upload - which JAR is required?
Cannot get Netscape 6.1 to open save as dialog box
What's the best way to download files from a web app?
JBOSS CMS opening txt Files