Good day. It became necessary to write a script that would receive information from the user's file and display it in the browser. On HTML5, I was able to do just something similar using FileAPI - a window was opened in which the required * .txt file was selected and its contents were displayed through innerHTML to the browser. It works correctly only in the latest version of FireFox.
The question is - can any other technologies (ActionScript + Flash / Air, Java) be similar, but without the need to choose a file? For example, when installing the required certificate.

  • For webmoney, it seems, they somehow do it. - Less
  • it also came to mind ... they have a trust certificate there that is used. - Realetive

2 answers 2

In Java, you can simply open the desired file and that's it. Only it is necessary that the application be signed, otherwise it will not be given access to the file system.

UPD

You did not immediately reveal your goals. If you just want to give the "right" people access to the file, and access to it equates to the ability to log in, then why is it so difficult to do something? Well, then make the server part so that it receives people from the required subnets without any passwords. Or use the certificate as an authorization method and share this certificate with "your" people.

  • That is, a direct access to the file at an address like "D: \ File \ filename.txt" without dialog boxes (I was just interested in it)? - Realetive
  • Well, yes .. just like usual reading from a file - cy6erGn0m

In fact, FileApi is supported by all the latest browsers. EVEN IE (9th)!

And why do you need a file? Maybe you will be enough local storage (LocalStorage)?

Or even cookies?

  • No, shurik, unfortunately, cookies will not work. LocalStorage, in my opinion, will store data only during one session, and this data should be prematurely placed into this LocalStorage. In general, the idea with cookies is good, but what if, for example, I would like to store files on a shared disk, and users will get access in the domain limit via a browser? That is, for example, files with logins and passwords are stored on a shared disk, users get access to data only while on the same subnet. - Realetive