Reputation: 43
I am trying to read files from my music directory on my PC. I have tried doing it with the node.js file system module, but it is not working. How do I get it to work?😢
Upvotes: 1
Views: 4592
Reputation: 133
Just a late follow-up. It is possible to read and write files using HTML5 with the FileReader and saveAs(). The browser will open a file dialogue and let the user choose the file, so the user is aware of the file access. It is not possible to read or write to a file without the user's attention.
https://developer.mozilla.org/en-US/docs/Web/API/FileReader
Upvotes: 3
Reputation: 1552
As said by @flame in a comment, it's just impossible, because the browser never have access to the visitor's disk (do you imagine the security issue if it was the case ?).
Vue.js is a Front-end framework, so the application it produces only have access to what the browser has access to.
Upvotes: 0