Snippet to download a file via a service?
Is there a code snippet to download a file from a repository? I'm looking to download a file from within a service.
I want to avoid having to use a widget (e.g. link or data export), and wondered if there was any way to kick off a download from within a script. I realise I can use the GetFileListingsWithLinks to get the url, but how can I then activate that url from within a service.
What I actually want to happen is: on the click of a button I want to run a service that creates a file, writes some data (based on some user defined parameters), saves it, then automatically begin the download. Ideally after the download I would like to delete the file.
TIA
K

