Answer the question
In order to leave comments, you need to log in
How to pass data from local file to javascript?
The user has a local file. You need to read this file and pass it to javascript. And then write somewhere to read from php (if possible). How to do it and in what language is it better to do it?
(Perhaps this can be written to a cookie, cache or web variable)
Answer the question
In order to leave comments, you need to log in
The only option is a desktop application on JS'e. You cannot do this in a browser, you can only work with cookies, sessions and storage from it.
Javascript does not have access to the file system. Try to <input type="file">
send it to the server, read it there and return the content through the same php. By the way, you can send files without rebooting (google)
You need an html form to select a file and some php to process the file.
You can also read here: www.html5rocks.com/ru/features/file_access
Such functionality can only be implemented through Java applets or the like (namely Java, not JavaScript), in JS itself, the browser completely restricts access to the user's computer (to avoid downloading viruses and other things).
So not how. If JS was capable of such things, it would somehow not be dangerous to live...
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question