Re: AjaxUpdateLink and Downloading File
Re: AjaxUpdateLink and Downloading File
- Subject: Re: AjaxUpdateLink and Downloading File
- From: Johann Werner <email@hidden>
- Date: Sat, 23 Feb 2013 22:05:10 +0100
Hi Raymond,
for file downloads you should use normal WOHyperlink and not the ajax kind.
jw
Am 21.02.2013 um 14:44 schrieb Raymond NANEON <email@hidden>:
> Hi,
>
> I want to use AjaxUpdateLink to download an xml file
> Here is the java method
>
> public WOActionResults detailProjetXML(){
> ....
> NSData xmlData = EditionsDetailProjets.detailXmlProjets(bindings, sess);
> ERXResponse erxResp = new ERXResponse();
> if (xmlData != null) {
> erxResp.setHeader("maxage=1", "Cache-Control");
> erxResp.setHeader("public", "Pragma");
> erxResp.setHeader(fileName, "Content-Title");
> erxResp.setHeader(CktlDataResponse.MIME_XML, "Content-Type");
> erxResp.setHeader(String.valueOf(xmlData.length()), "Content-Length");
> erxResp.setHeader("attachement; filename=\"" + fileName + "\"", "Content-Disposition");
> erxResp.setContent(xmlData);
> } else {
> erxResp.setContent("");
> erxResp.setHeader("0", "Content-Length");
> }
> return erxResp;
> }
>
> in wod :
>
> ReportingXml : AjaxUpdateLink {
> action = ctrl.detailProjetXML;
> name = "xml - détaillé";
> onComplete = "function() { menu.hideMenu(); }";
> }
> When I click on reportingXml link, nothing happens. There are no file to download.
>
> What I am doing wrong?
>
> Thanks for your help.
>
> Envoyé depuis iCloud
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden