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 in some other way.
Ideally I would like test this by having my browser rename a file on my desktop.
You can't modify local files from Javascript.
Web browsers (and JavaScript) can only access local files with user permission. To standardize the file access from the browser, the W3C published the HTML5 File API in 2014. It defines how to access and upload local files with file objects in web applications.
HTML 5 provides a standard way to interact with local files with the help of File API. The File API allows interaction with single, multiple as well as BLOB files. The FileReader API can be used to read a file asynchronously in collaboration with JavaScript event handling.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With