Linked Questions
208 questions linked to/from How to create a file in memory for user to download, but not through server?
357 votes
9 answers
1.1m views
Create and save a file with JavaScript [duplicate]
I have data that I want to write to a file, and open a file dialog for the user to choose where to save the file. It would be great if it worked in all browsers, but it has to work in Chrome. I want ...
35 votes
3 answers
64k views
Is possible to save JavaScript variable as file? [duplicate]
Is there a way to convert a string from a JavaScrip variable, into a downloadable file that users can download when clicking a button ? Thanks for any advice. <div id="txt">Lorem Ipsum&...
32 votes
3 answers
84k views
How to create a dynamic file + link for download in Javascript? [duplicate]
Typically, HTML pages can have link to documents (PDF, etc...) which can be downloaded from the server. Assuming a Javascript enabled webpage, is it possible to dynamically create a text document (...
7 votes
1 answer
21k views
How to programmatically create a client side file in Javascript that can be downloaded by the user? [duplicate]
I wanted to experiment creating a Javascript application that takes input from the user in a form and then generates a file based on the user's form input. The file should then be downloadable by the ...
12 votes
2 answers
11k views
Force download for blob created with FileWriter in JavaScript [duplicate]
HTML5 introduces the FileWriter class. With this class you can make Blobs. (A File is an extension of a Blob.) With JavaScript you can make a Blob and for instance show it using the dataURL. Example: ...
2 votes
2 answers
9k views
create json file in javascript [duplicate]
I am trying to create a json file from javascript . since i didnt get the code i am trying to create a text file as .. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <html>...
0 votes
1 answer
5k views
How to save JSON file using JavaScript in Front-End? (Non-NodeJS) [duplicate]
How to save this data into JSON file? var objJson = { questionType : "singleLine", maxCharecters : 25, question : "What is the capital of India?", answer : "Delhi"...
2 votes
1 answer
3k views
Is it possible to store or export a localStorage JSON file to disk? [duplicate]
I have a schedule app built with AngularJS and I'm looking for a way to save the data changed within the app to disk after I close it. When I open the app again I want it to read the freshly modified ...
0 votes
1 answer
1k views
String to txt file in JQuery single page app [duplicate]
I am developing a single page app with Jquery. The user does some stuff on my app and I save some data in a JSON. Now I want to trasform the JSON in a text file and start the file download. How can I ...
0 votes
2 answers
823 views
How to download a complete html code with .html format? [duplicate]
HI I am creating a dynamic html section and I have two buttons: preview and download. The preview is fine working. As for the second button, i.e. download, I want to make the action of the button ...
0 votes
0 answers
910 views
Generate .txt file from string and force download in JavaScript [duplicate]
I use jQuery and JavaScript to build a web application. I want to somehow create a .txt file from a JS string and force the client's browser to download this file. Preferably the file should not be ...
1 vote
2 answers
550 views
Write data used to plot d3 graphs in a file at client-side [duplicate]
I have plotted some graphs using d3.js. In d3.tsv function I have passed a URL to a php script that performs some query on database and returns output to the client in TSV format. e.g.: d3.tsv("...
0 votes
0 answers
361 views
Downloading array of image url in javascript [duplicate]
I am wondering how to download all images , based on the URL in an array. I have an array like such for example ['https://url/image1.jpg', 'https://url/image2.jpg'] I have introduced a piece of code ...
0 votes
1 answer
224 views
Saving JSON object on my hard drive using js [duplicate]
I wrote code that allows me to create polylines on the fly by clicking on the container that is listening for clicks. My intention is to be able to save individual polylines by writing the points ...
-4 votes
1 answer
249 views
How do I replace writeFileSync() with regular JavaScript [duplicate]
I want to make a PHP file without nodeJS but var fs = require('fs') does not work in regular JavaScript so fs.writeFileSync() can't work. Is there a replacement for that? My code: <script> fs....