Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 4 of 4 total
Thread Creating a downloading file from text
Sun, Jan 27 2019 11:02 AMPermanent Link

Stephen Kenny

In response to a button press, how to I cause a load of text - created in real time - to be downloaded to the user's desktop as a file.

I could do it by moving the code into a webservice and calling from a link, but I'd rather do it this way.

I feel I'm missing something pretty obvious, as it's a simple problem in server side languages.

Stephen
Sun, Jan 27 2019 1:51 PMPermanent Link

ooptimum

Try to download from a Data-URL like <a href="data:...." target="_blank">.
Sun, Jan 27 2019 1:54 PMPermanent Link

ooptimum

Tue, Jan 29 2019 11:16 AMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Stephen,

<< I feel I'm missing something pretty obvious, as it's a simple problem in server side languages. >>

It's a simple problem to solve server-side because server-side languages are typically not running in a highly-secured sandbox that doesn't have direct access to the local file system.

In general, I would always recommend generating this type of thing from the server.  It avoids a lot of pain compared to navigating the differing ways in which dynamically-created DOM elements can behave in the various browsers.

Tim Young
Elevate Software
www.elevatesoft.com
Image