I want to develop a servlet that forces a file download. How did you do it?

----------
>From: Arend van der Veen <[EMAIL PROTECTED]>
>To: [EMAIL PROTECTED]
>Subject: IE 5.0 and File Download Servlet
>Date: Thu, Apr 22, 1999, 7:21 AM
>

> I have been away from the list for awhile and don't know if this has been
> already discussed.  I have looked in the archives but did not find any
> answer.
>
> A year ago I developed a servlet  that forced a file download.  The contents
> of the file comes from a database.
>
> Before I started to output the contents I did the following:
>
> ares.setContentType("application/octet-stream");
> ares.setHeader("Content-Disposition","inline; filename="test.bin")
> ares.setContentLength(lTotalLength)
> ServletOutputStream aout = ares.getOutputStream();
>
> < send contents to aout>
>
> where ares is the HttpServletResponse and lTotalLenght is the content
> length.  This currently works with NS 4.51 but IE 4.0 gets real mad.  The
> file download dialog comes up and then I get an error stating that it is not
> able to download www.your.domain.com/servlet/DownloadServet?Name=XYZ. form
> yyy.domain.com.
>
> Does anybody have a solution to the problem ?
>
> Thanks in advance,
> Arend van der Veen
>
> ___________________________________________________________________________
> To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
> of the message "signoff SERVLET-INTEREST".
>
> Archives: http://archives.java.sun.com/archives/servlet-interest.html
> Resources: http://java.sun.com/products/servlet/external-resources.html
> LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".

Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

Reply via email to