How to read and write into file using JavaScript?

后端 未结 17 2497
孤街浪徒
孤街浪徒 2020-11-22 02:00

Can anybody give some sample code to read and write a file using JavaScript?

17条回答
  •  鱼传尺愫
    2020-11-22 02:41

    You cannot do file i/o on the client side using javascript as that would be a security risk. You'd either have to get them to download and run an exe, or if the file is on your server, use AJAX and a server-side language such as PHP to do the i/o on serverside

提交回复
热议问题