html or javascript code to create a text file in hard disk

前端 未结 2 1026
星月不相逢
星月不相逢 2021-01-29 01:59

Please someone give me a code to create a text file in hard drive

Result should be a html file, when double click html file it need to create a text fil

2条回答
  •  别那么骄傲
    2021-01-29 02:48

    Javascript in a regular HTML page in a browser is not allowed direct access to a path of your choice on the hard disk for security reasons.

    The, somewhat experimental, FileSystem APIs in newer browsers offering some capabilities to a sandboxed file system, but you will have to see if your need can be satisfied with those APIs.

    Other than that, you would need some way around the security limitations such as doing it from a browser plug-in that the viewer has authorized and installed.

提交回复
热议问题