I am currently working on developing a website that allows clients to set up certain settings, which can then be written to a file within my project's filesystem rather than their own. This file will then have some parts overwritten and must be saved to the local storage.
For instance:
template_file.txt has the following contents:
My favorite color is WHITE.
I like GREEN tea with lemon.
Leaves on the trees are GREEN.
The web page initially displays something like:
[Empty Text Field 1 Here]
[Empty Text Field 2 here]
[Empty Text Field 3 here]
Filename: [Empty Filename Field here]
{OK Button}
{Save File Button}
(The text of template_file.txt is not visible to the client, but it is part of the website's project.)
Client input:
[red]
[black]
[Empty Text Field 3 here]
Filename: [generated_file]
{OK Button}
{Save File Button}
(Field 3 remains unchanged, {OK Button} clicked.)
generated_file.txt contains:
My favorite color is red.
I like black tea with lemon.
Leaves on the trees are GREEN.
({Save File Button} clicked. => The site suggests saving generated_file.txt to the local filesystem.)
I came across a tutorial on how to save all the text from a textarea to a file at this link:
Loading, Editing, and Saving a Text File in HTML5 Using Javascript
However, I am unsure about generating a file using a partially overwritten template file from the web for this purpose. Any guidance or advice on whether this is possible would be greatly appreciated.