Hi Kjell Arne,

Thank you very much for your reply. That was pretty quick :).

I don't think you will be able to save anything programatically to
the client machine from the browser.

Yes, I am aware of that, but thank you for reminding.

I know of only two options or workarounds. Either you have to instruct the
user to save the whole document from the file menu,

Oh, I wish the customer was that compassionate and understood the hardship of being a developer. :)


or you can use a Flash
swf or Java applet/program. At least you would have some possibility to save
to the client's hard disk.

This is not an option, as I don't think I am allowed to introduce any extra requirements to the browser (i.e. having flash/applet viewer installed).


Instead I wanted something like sourceforge downloads. You know when you click on "download" link, the same page is still displayed in the browser, but then a few seconds later "Save file" dialog box pops up, that lets you save the selected file to the disk (this sentence really gets me nailed, as it's not a Cocoon question - more like a JavaScript/browser one).

AFAIK such functionality can be accomplished by setting refresh meta tag in the header of the html page. It's "nice-and-easy", but I can't do that either, as what I am working on will be used in cocoon portal (which I think strips out all the html/head/body tags by default (for cachingURIcoplets), and it doesn't look right to hack the skin to allow for this one case).

So the problem are these:
1) which mime type needs to be selected for the serializer so that browser doesn't show the result but rather prompts to save it. Is it ok, if I put something that I know is not supported i.e.
<map:serialize
type="xml"
mime-type="application/my-not-supported-type"/>


2) how to make sure that a new window is not opened, and the old one stays unchanged and the save-as dialog is still showed? (looks like an impossible task to me)

Thank you once again.

Sincerely,
Nick Goupinets.

-----Original Message-----
From: Nick Goupinets [mailto:[EMAIL PROTECTED] Sent: 20. februar 2005 15:49
To: [email protected]
Subject: Save pipeline results on client


Hi everybody,

Thank you for reading this post. I need some help with storing pipeline
results on the client side. The ultimate goal is to have somewhere a button,
which, when clicked, will provide a "Save as" dialog box, so that the user
will be able to save the produced XML to his or her file system.

When I was trying to implement that, I could not come up with anything
better, than having a JavaScript enabled button, that will open a new
browser window. Window's location will point to a pipeline which ends with
an XML serializer with some non-default mime type (or I guess, I can make a
reader for this purpose). As the result, the browser will not try to render
the content, but rather offer a dialog box that prompts user to either
select a suitable application to work with the file with or to save it to
disk.

Are there any more elegant solutions? Thank you very much for your time.

Sincerely,
Nick Goupinets.

---------------------------------------------------------------------
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]



--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to