<?xml version="1.0" encoding="utf-8"?>
<rss xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title>Answers to: How to programmatically download a file from Ivy-Server "files/application"-folder into a folder on the client with JSF?</title><link>https://answers.axonivy.com/questions/1471/how-to-programmatically-download-a-file-from-ivy-server-files-application-folder-into-a-folder-on-the-client-with-jsf</link><description>&lt;p&gt;Hello!
How can I download a file from the Ivy-Server's "files/application"-folder to a folder on the client with JSF per program-code?
We are using only JSF in this project. No RIA.
Is it possibly to download a file to the client without user-interaction in JSF, at all?
Kind Regards,
Helmut&lt;/p&gt;</description><atom:link href="https://answers.axonivy.com/questions/1471/how-to-programmatically-download-a-file-from-ivy-server-files-application-folder-into-a-folder-on-the-client-with-jsf" rel="self"></atom:link><language>en</language><lastBuildDate>Mon, 14 Sep 2015 10:28:16 -0400</lastBuildDate><item><title>Answer by Reguel Wermelinger</title><link>https://answers.axonivy.com/questions/1471/how-to-programmatically-download-a-file-from-ivy-server-files-application-folder-into-a-folder-on-the-client-with-jsf/1473</link><description>&lt;p&gt;In my project I solved it via the RequestContext framework from primefaces. It lets you invoke java script code on the client. And in this case I send a redirect to my file as javascript command. The following code should work in a dialog script activity:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;import org.primefaces.context.RequestContext;
String redirectScript = "window.location.href='"+ivy.html.fileref(in.exportedFile)+"';";
RequestContext.getCurrentInstance().execute(redirectScript);
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img alt="sample project context" src="http://answers.axonivy.com/upfiles/redirectToFile_viaRequestContext.png"&gt;&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Reguel Wermelinger</dc:creator><pubDate>Mon, 14 Sep 2015 10:28:16 -0400</pubDate><guid>https://answers.axonivy.com/questions/1471/how-to-programmatically-download-a-file-from-ivy-server-files-application-folder-into-a-folder-on-the-client-with-jsf/1473</guid></item></channel></rss>