Jump to content
COMFIED

Downloading Memo Contents as a File

Recommended Posts

I would like to populate a hidden memo field with text, and then download the contents as a text file by clicking on a button.

Any ideas on how I can do that?

Share this post


Link to post
Share on other sites

Here's example for csv file:

	var csv: string;
	begin
	  csv := 'Field1,Field2,Field3' + #13#10; // Add other lines to it
	  var link = w3_createHtmlElement('a');
    link.href := 'data:text/csv;charset=utf-8,' + EncodeURI(csv);
    link.target := '_blank';
    link.download := 'CarlSearch.csv';
    BrowserAPI.Body.appendChild(link);
    link.click();
    BrowserAPI.Body.removeChild(link);
	end;
	   
	

 

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...