Can a Java applet open a “select directory” and write to a filesystem via JavaScript interaction?

后端 未结 3 764
闹比i
闹比i 2021-01-24 02:28

I am looking for a way to save a couple of files created with JavaScript on the clients computer. I want him to be able to choose a folder (similar to open/save folder dialog),

3条回答
  •  悲哀的现实
    2021-01-24 03:27

    If your applet is signed you can do everything that you can do in regular application. You can open "File dialog" but it will be the Java's dialog, not the same that is opened when user pushes "browse" button of tag . Obviously signed applet can perform read and write operations with user's disk.

    All applets (either signed or unsigned) may call javascript using JSObject. You just have to say MAYSCRIPT="true" into applet tag.

    I think that you cannot open the browser's "file open" dialog applet. Actually you even cannot open it using regular javascript. (I'd be happy to know that I am wrong at this point but I spent some time trying to do this and failed).

提交回复
热议问题