Question
National Account Service Company LLC (NASCO)
US
Last activity: 22 Jun 2016 10:27 EDT
creating file on user machine
Connect File rule creates file on server Pega application hosted - is there a way to create this file on user machine ?
-
Like (0)
-
Share this page Facebook Twitter LinkedIn Email Copying... Copied!
Pegasystems Inc.
US
In general it is advisable to create/process a file and then send it to the user's browser so they may choose to open/save it.
Pega's PublicAPI provides methods for sending files to users.
National Account Service Company LLC (NASCO)
US
thanks Jeff, let me explore PublicAPI to check which methods i can use to create & read file from users local machine.
Updated: 20 Jun 2016 17:55 EDT
National Account Service Company LLC (NASCO)
US
Jeff, I have gone through Engine API from Resources link in Pega but could not find API to export clipboard data into file on client machine. Any other clue ?
Pegasystems Inc.
US
Jeff, thanks for input. Can you specify which Public API you are referring to? Does this require user action to save/open?
Our use case requires to save a file to client machine automatically upon a button click.
Pegasystems Inc.
US
Look at the different versions of the "sendFile" method of Public API (sometimes called Engine API).
When you are in the Pega designer studio, click the help/resources button and click :"Engine API" in the menu that appears.
Find the "PublicAPI" class in the navigation pane.
In a java step of an Activity, or within a Rule-Utility-Function, you can use the identifier "tools" to reference a PublicAPI that has already been instantiated for you.
The behavior on the client side is defined by the browser's settings, so there's no guarantee that the user will not be prompted to allow the download and/or choose a folder for the download.
Pegasystems Inc.
US
Jeff, this is the approach we are exploring. Seems feasible. Any thought?
This also writes a file to client machine directly.
This calls a JS function with a parameter from Clipboard property
I am wondering if there is a JS code that can write a file without requiring ActiveX. But the following example works fine in IE with ActiveX enabled.
A local file is created.
Jeff, this is the approach we are exploring. Seems feasible. Any thought?
This also writes a file to client machine directly.
This calls a JS function with a parameter from Clipboard property
I am wondering if there is a JS code that can write a file without requiring ActiveX. But the following example works fine in IE with ActiveX enabled.
A local file is created.
Pegasystems Inc.
US
Interesting!
I did not think of any JavaScript solutions as I am not much of a JS developer. I hope someone else can reply with ideas that do not require ActiveX, because being locked-down to IE will probably be less than desirable.