How to read and write into file using JavaScript?

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

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

17条回答
  •  青春惊慌失措
    2020-11-22 02:32

    The future is here! The proposals are closer to completion, no more ActiveX or flash or java. Now we can use:

    • File System APIs

    • Native Drag&Drop File Access

    You could use the Drag/Drop to get the file into the browser, or a simple upload control. Once the user has selected a file, you can read it w/ Javascript: http://www.html5rocks.com/en/tutorials/file/dndfiles/

提交回复
热议问题