Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Downloading/opening file in IE

1 view
Skip to first unread message

Måns Danielsson

unread,
Dec 1, 2000, 3:00:00 AM12/1/00
to

Hello
I have written a Java Servlet which, among other things, allows users
to upload and download files to a server.

The downloading part is implemented by way of an anchor-tag,
which responds to clicking by sending information to the servlet
on which document is wanted. The target of the anchor-tag is
set to _blank.

The servlet retrieves the mime-type of the document from a database,
and returns the file as an OutputStream, setting the content type of
the response to this mime-type if the user wants the browser to try
and open the file, or to application/octet-stream if the user requests
download only.

This works fine in NN: if the response content-type is set to
application/octet-stream, Netscape opens a Save as....-subwindow.
Explorer, however, takes no notice of the response mime-type. Instead,
it always tries to open the document, with a resulting error if the file

type is not known. And if it opens the Save as...-subwindow, it often
also opens a new browser window with the 404 message.

If anybody knows how to force 'downloading only' in Internet Explorer,
I would be very happy if you let me know.

Thank you,
Maans


0 new messages