Allow download of a "virtual" file

  • Thread starter barthelemy.von.haller
  • Start date
B

barthelemy.von.haller

Hello !

I am having a problem which I thought was an easy one but which starts
to drive me crazy.

Imagine that I have a text displayed in a div. I would like a button
to download a text file containing this text (no formatting, just
text).

How should I do that ?
Can I somehow build a file in javascript and then propose to the user
to save it ? (the normal "save or open with" dialog)

Or am I forced to have a temporary file on the server to link to ? and
then wouldn't the browser simply display this txt file instead of
proposing to save it ?

Any help would be welcomed !
Thanks in advance

Barth
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top