How jquery works with files

Can jQuery / javascript read / receive the contents of the file on the client side, where the file is an image or text, and store it in a variable?

EDIT: whether the file placed in the processed client can

+3
source share
4 answers

For a security issue, JS cannot read / write files from client machines. Try the Java applet if you are from the Java field, Silverlight from .NET.

+1
source

This is not possible, for obvious reasons, as soon as you think about possible use cases:

$(function() { //This doesn't work, just an example
  $.getFile("C:\YourPasswords.txt");
});

, :)

+4

, javascript javascript clientide.

You will need to use an external plugin that allows for such as Java.

+2
source

You can do this using Universal Access XP with Firefox or ActiveX with IE.

You can check the sample code for this from http://code.google.com/p/memonaut/source/browse/trunk/app/saver.js

Sample code to save; similar material should be readable. Hope this helps.

+1
source

Source: https://habr.com/ru/post/1736880/


All Articles