This function (probably) does not do what you think it does in a Perspective context. Perspective scripts are actually running on the gateway, so this will be attempting to write to a file on the C drive wherever the gateway is installed, not wherever your browser session is running.
You (probably) want the system.perspective.download function.
It works but it still pops and error with this in the Output Console: [AWT-EventQueue-0] ERROR com.inductiveautomation.ignition.client.util.gui.ErrorUtil -- Unable to run action 'dom.onClick' on Main Views/Alarm Journal@D/root/CoordinateContainer: code could not be compiled.
java.lang.Throwable: SyntaxError: no viable alternative at character '�??' (function:runAction, line 2)