cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Robby Pelssers" <robby.pelss...@ciber.com>
Subject RE: [C2.2] Original name of uploaded file
Date Mon, 18 Apr 2011 14:15:08 GMT
I'm not sure how to retrieve filename in your case but below you can find a working sample
of how to set the filename of attachment from flowscript:

	function downloadZIP(viewData) {
		//we have to change the filename of attachment
		var response = cocoon.response;		
		response.setHeader(
		    "Content-Disposition",
		    "attachment; filename=" + viewData.id + ".zip"
		);		
		
		cocoon.sendPage(
			"eps/" + viewData.id + ".zip", 
			{
			    "data": viewData
			}
		);	
	}

Kind regards,
Robby
-----Oorspronkelijk bericht-----
Van: Matthias Müller [mailto:pymote@yahoo.de]
Verzonden: ma 18-4-2011 14:46
Aan: users@cocoon.apache.org
Onderwerp: [C2.2] Original name of uploaded file
 
Hi there,

in my cocoon app i have a simple transformation xml -> fo -> pdf. The resulting 
pdf needs to be named as the uploaded xml file + .pdf extension.
How can I achieve that? Is there a way to access the data of the uploaded file 
in the sitemap.xmap / flow.js?

Matthias


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org



Mime
View raw message