Modifying Local Files Using HTML5 and JavaScript

前端 未结 3 467
闹比i
闹比i 2020-12-05 15:43

Is there any way I can use HTML5 and JavaScript to modify a file on my system? I\'m OK with running Chrome or Firefox with specific options or opening permissions i

相关标签:
3条回答
  • 2020-12-05 15:47

    No, as this would be a security vulnerability. As pointed out there are sandboxed file systems, or local database storage in HTML5, but not access to the whole file system.

    You could achieve it with a certified Java applet, if you really wanted to achieve it through the browser. To be honest the browser is not the best place to be trying such things.

    0 讨论(0)
  • 2020-12-05 15:49

    Yes, you can do this, this link details some of the available functionality:

    http://www.html5rocks.com/en/tutorials/file/filesystem/

    Just remember, it's not supported in the major browsers yet, and it's likely when it is many of your visitors will not upgrade for quite some time.

    0 讨论(0)
  • 2020-12-05 15:53

    VBScript should be appropriate in your case. You will have to lower your internet zone security level though.
    Once it's done just use ActiveXObject("Scripting.FileSystemObject") and its MoveFile method.

    0 讨论(0)
提交回复
热议问题