Followup:
In the article quoted previously:
http://www.onjava.com/pub/a/onjava/excerpt/jebp_3/index3.html
the code for setting content type and disposition are given as:
res.setContentType("application/x-download");
res.setHeader("Content-Disposition", "attachment; filename=" +
filename);
Can someone provide a simple example of how this would
look in Cocoon for a dynamically generated file? Are the
above settings provided in the sitemap - if so how?
If not, where else?
Thanks
Derek.
>>> [EMAIL PROTECTED] 2005/02/26 10:07:57 PM >>>
Nick Goupinets wrote:
> Hi everybody,
>
> Thank you very much for your support. The proposed solution was
correct,
> the "SaveAs" dialog pops up with content disposition set up properly
and
> the default mime type.
>
> However, it appeared to be easier than expected to get the pop up
from
> the browser. It is not necessary to open up a new window. It is
> sufficient to change current window location.href property (original
> window content remains unchanged):
>
> function saveResult(){
> var index = document.MyForm.SelectionBox.selectedIndex;
>
> if (index == -1)
> alert("Please make a selection first");
> else {
> window.location.href =
> 'coplets/myprojects/dataBench/saveResult?resultNum=' + index);
> }
> }
This is also a good idea. As long as you do not have to support
browsers
that restrict javascript functions that can be run.
--
Leszek Gawron
MobileBox
[EMAIL PROTECTED] http://www.mobilebox.pl
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]