You can't force anything to happen on the client side by using server side
code (e.g. JSP). The best you can do is tell the client what type of data
to expect in response to its request, which you are already doing by setting
the content-type response header. This won't force WinZIP to open, it will
simply tell the browser that data of type application/x-gzip is being
returned. What the client machine decides to do with that data after it has
downloaded is up to it - it may have WinZIP set up to handle all
application/x-gzip files, or it may have some other app. It may have
nothing at all.
I've found that trying to coerce data use on the client side from the server
side relies on expecting a standard user environment on the client machine.
This is fine if you are working on an intranet with strictly controlled
SWEs, but for anything else it's better just to include a link on a page and
let clients click on it.
This really only causes headaches if you are trying to return binary data
from a database.
I've also found that some browser/platform configurations totally ignore the
response header and rely on the URLs extension to map against the clients
mime types and thus determine what app to use to view the data.
Hope this makes sense!
-----Original Message-----
From: Sunny Yang [mailto:[EMAIL PROTECTED]]
Sent: Friday, November 05, 1999 6:15 AM
To: [EMAIL PROTECTED]
Subject: how to send a response to force the browser to launch winzip?
Hi:
I have a question.
How to write a jsp to send a response to force the browser to
launch winzip on Windows platform?
I tried response.setHeader("content-type","application/x-gzip"); But
it didn't work.
Thanks a lot
Sunny
=====
__________________________________________________
Do You Yahoo!?
Bid and sell for free at http://auctions.yahoo.com
===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff
JSP-INTEREST".
FAQs on JSP can be found at:
http://java.sun.com/products/jsp/faq.html
http://www.esperanto.org.nz/jsp/jspfaq.html
===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
FAQs on JSP can be found at:
http://java.sun.com/products/jsp/faq.html
http://www.esperanto.org.nz/jsp/jspfaq.html