问题
I want to make some file operation using Javascript or jQuery for Cross Browser like:
File create
File write
File read
Update
Remove/delete
Is it possible to do above stuffs? If possible, from where I can get the idea? Please suggest me.In any end (client/server) how can it be done?i asked this just for know!
回答1:
No you can't do such type of operation on browser.
You need Server Side JavaScript Node.js.
There are lot of details in Filesystem
Write a file example
var fs = require('fs');
fs.writeFile("yourpath", "Hello", function(err) {
if(err) {
console.log(err);
} else {
console.log("The file was saved!");
}
});
回答2:
No you cannot do this kind of operations on all browsers.
The functionality you are looking for can be accomplished using ActiveX in Internet Explorer only
Html 5's File Api also exist but has many limitations:
Items in one application’s Sandbox are invisible to others.
Items in the Sandbox is invisible to other types of web browsers. For example, a Sandbox created in Google Chrome is invisible to other non-Chrome browsers.
Items in the Sandbox is invisible to non-browser programs.
For more info on this visit this
来源:https://stackoverflow.com/questions/21328689/how-to-use-file-system-or-operation-using-javascript-or-jquery