Convert Text into file and prompt the user to download it.

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • XNeat
    New Member
    • Feb 2008
    • 4

    Convert Text into file and prompt the user to download it.

    I am writing the documentation of my XNeat.

    The code sample is included within Pre tag.

    Is there exist a javascript solution that will allow me to convert the text within this <Pre> tag into file and prompt the users to download it ?

    you may take a look into this page to know what i am talking about at this link

    i want to have a link under the code in gray that allows the users to download this code.

    I want to make it dynamically without going in the headache of having those files on my server.

    Thanks in advance
    Sa6ry
  • acoder
    Recognized Expert MVP
    • Nov 2006
    • 16032

    #2
    You can't create a file using JavaScript, but you could create one dynamically on the server, force the download and then delete (after, say, an hour).

    Comment

    Working...