0

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!

2
  • You can't read or write files at the client side with Javascript, with an exception being <input type="file">. It's a security issue. Commented Jan 24, 2014 at 9:16
  • 1
    Maybe you should specify WHICH filesystem you are wanting to destroy, cough! ..operate with.. :) As client side Javascript operates on your (client) machine and comes from a server, you may specify if you want to modify files on the client machine (security risk), or on the server (you connect and upload/remove a file). Of course that is different from Server Side Javascript (Node.js) that can operate on files quite well. Commented Jan 24, 2014 at 9:21

2 Answers 2

2

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!");
    }
}); 
Sign up to request clarification or add additional context in comments.

1 Comment

Please explain node.js example with demo link
1

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

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.