Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7972943
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T07:58:57+00:00 2026-06-04T07:58:57+00:00

i want to create a text file from a string. currently i am using

  • 0

i want to create a text file from a string. currently i am using a function which takes an array and makes it into a string then using that string i want to create a local text file the user downloads.
i have tried using this method

   function createFile(){ //creates a file using the fileLIST list 
    var output= 'Name \t Status\n'+ fileLIST[0][0].name+'\t'+fileLIST[0][1]+'\n';
    var Previous = fileLIST[0];
    for (var i=1; i<fileLIST.length; i++)
        if (fileLIST[i][1] =='none' || fileLIST[i][1] == Previous[1])
            continue
        else {
            Previous = fileLIST[i]
            output = output + fileLIST[i][0].name +'\t'+fileLIST[i][1] + '\n';}

    window.open("data:text/json;charset=utf-8," + escape(output));//should create file
    display();  }

i am using chrome as my browser. also i would prefer JS or HTML5 answer.

thank you in advance

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T07:58:58+00:00Added an answer on June 4, 2026 at 7:58 am

    i ended up using this code instead. it creates a link to download the url of the file.

         window.URL = window.webkitURL || window.URL;
        window.BlobBuilder = window.BlobBuilder || window.WebKitBlobBuilder ||       window.MozBlobBuilder;
        file = new WebKitBlobBuilder();
        file.append(output); 
        var a = document.getElementById("downloadFile");
        a.hidden = '';
        a.href = window.URL.createObjectURL(file.getBlob('text/plain'));
        a.download = 'filename.txt';
        a.textContent = 'Download file!';
    }
    

    also this way adds less to the website making it a lighter website for slow connections.
    my html has a empty div in which this appends to.

       <div class ='paginationLIST' id='pagination'></div>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to be able to create a temporary text File in Java to
I want to create a form which has a text entry box where a
I want to create a plugin 'myPlugin' which simply add some text to a
In Java I want to create a file from and save the data on
I'm trying to create a singly linked list from an input text file for
I'm writing a basic program that copies a string from an existing text file
I want to pre-append some text a a CSV file that is created by
I want to create 5 text boxes created on drop down selected index change
I want to create a fading effect of text in Label control. I change
I want to create super script for desired text selected by user. I found

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.