2

Is there any method to use to save data from webpage to excel file or text file using jquery ?

Curtis
  • 101,612
  • 66
  • 270
  • 352
Roland
  • 181
  • 1
  • 5
  • 11
  • no you cannot do that using jquery, see following: http://stackoverflow.com/questions/582268/read-write-to-file-using-jquery – Vikram Feb 24 '12 at 09:58

1 Answers1

2

There's no purely client-side solution using only a browser and jQuery, no. You either have to involve a web server (and even then, the user has to handle the "save file" dialog box), or a "thick" technology like Flash or a signed Java applet. (In either case, the user would have to grant the permissions to do it; most users being somewhat — and appropriately — paranoid, you'd have to already have a relationship with them.) Even the new File API, which offers limited access to the local file system (with the user's permission), doesn't support writing files.

You can open a window with the file data in it, but then the user has to take the action of saving it to disk.

T.J. Crowder
  • 1,031,962
  • 187
  • 1,923
  • 1,875
  • I have got this page : http://jquery.tiddlywiki.org/twFile.html , is it ok to use it , i dont want to have heavy code , im not so good at coding ? – Roland Feb 24 '12 at 10:17
  • @rolandfeghaly: I'm not familiar with it, but note that it says it only works from local files (`file://` URIs). And it uses "thick" technologies (ActiveX, Java, etc.). – T.J. Crowder Feb 24 '12 at 10:29