#EANF#
I want to access a local file (read-only) chosen by the user. I know
that's not possible with JavaScript (at least not currently and in all
browsers).
However it is possible to upload a file using an HTML form and an input
with type=file. Now, obviously, when the user clicks on the submit button,
the browser needs to read the file into memory and put it into the request
body. So, in principle, read-only access to the file system already
exists.
I want to somehow intercept that request, read the file contents from the
request body into a variable, and stop the request from being send to the
server.
Is that at all possible or am I dreaming?
(I know that there are similar questions, but they are either slightly
different in what they ask for or the answer requires HTML5.)
No comments:
Post a Comment