How to output local files with js

this is the case. I want to make a table on the web page, and then generate a json file where the web page file is located. There are more blob,base64 methods on the Internet, but they are all downloaded through the browser after clicking. I would like to ask if there is a direct export method? Can ajax do this

Mar.14,2021

No, because js cannot read or write local files for security reasons.


if it is a web application, you cannot directly use js to output local files (the program specifies the storage location and does not require user intervention). If you are in the program, in the development of local applications such as electron, you can use js to output local files.
in the web application, you can output the file, and then simulate it as a download, let the customer click to download the data, and let the customer specify the storage location.


the problem description of the landlord looks very painful. Do I have dyslexia?

if the landlord is asking whether the front end can directly generate the download file?
the answer is yes, such as this: https://github.com/rainabba/j.

Menu