2

We have an Applet we used to zip files on the client machine and stream the content back to our servers. Our clients that have updated to the newer versions of Chrome are no longer able to use our Applet because Chrome does not support NPAPI plugins any longer. I think I have a couple of options:

  1. To somehow make the existing Applet work with Chrome (perhaps using JNLP? ) or some other method
  2. To find an alternative technology altogether

The solution has to be able to receive a list of folders, sub-folders and file names. It then has to be able to compress these files, if possible, then upload them to the server. I am open to any suggestions.

Dylan
  • 165
  • 2
  • 16

1 Answers1

4

You can

  • Read the file(s) with the File API, potentially letting the user add them to your interface via drag and drop (for a more convenient selection mechanism than boring <input type="file"> :-) ).

  • Zip them up in JavaScript using a library like JSZip (though if your server has gzip enabled, I'm not sure you gain a lot doing that; I haven't looked into it deeply, though)

  • Send them to the server either via HTTP POST (possibly multiple posts), or by using XMLHttpRequest2, or via web sockets.

Of course, your other alternative is to continue to use Java and have the users use Firefox instead of Chrome. Just beware that Mozilla is also looking to make a move away from NPAPI and away from supporting Java. About 20 months ago they weren't:

there are no plans of dropping support for java or other npapi plugins in firefox other than setting them to "ask to activate": https://blog.mozilla.org/security/2014/02/28/update-on-plugin-activation/

....but now:

Mozilla intends to remove support for most NPAPI plugins in Firefox by the end of 2016. Firefox began this process several years ago...

(which puts the lie to "no plans" in the first quote)

...Websites and publishers which currently use plugins such as Silverlight or Java should accelerate their transition to Web technologies.

T.J. Crowder
  • 1,031,962
  • 187
  • 1,923
  • 1,875
  • I have looked at each of these except HTTP Post. The thing is the user does not have knowledge of the root folder where the files reside. We read a file on their CD that gives us a list of files (in JSON). We then have to zip these files and stream them to the server. I have not been able to find a way to get File API or JSZip to address the folders and files recursively just using the JSON. – Dylan Oct 27 '15 at 15:40
  • @Dylan: For what may be obvious reasons, you can't. JavaScript code on browsers can only access files the user has *specifically* given access to, and to do that, the user has to know the path of the file so they can select it / drag it onto the page / whatever. We may well progress to the point where users can grant more permissions to individual pages at some point in the future, but for now, it's very softly-softly. – T.J. Crowder Oct 27 '15 at 16:41
  • @Dylan: I should have said above. Or use Firefox. (And now I have. :-) ) – T.J. Crowder Oct 27 '15 at 16:44
  • Mozilla said that a year and a half ago; much more recently they said that they plan to drop NPAPI support (with an exception for Flash) by the end of 2016. https://blog.mozilla.org/futurereleases/2015/10/08/npapi-plugins-in-firefox/ – smorgan Oct 27 '15 at 18:32
  • @smorgan: That's what I get for taking "(for now)" out of the above. About three months ago I said I was sure Mozilla was looking at dropping support (I'd seen some newsgroup post or some such but didn't have a link), and someone had a go at me saying I was wrong, they weren't going to, and linking to the above that I was mistaken. Thank you for the link saying actually, yes, they are. :-) – T.J. Crowder Oct 27 '15 at 18:47
  • All very good information. I will keep working on finding an alternative solution. We might end up trying file/folder drops. – Dylan Oct 28 '15 at 14:21
  • 2
    You can add folder input in Chrome with – Daniel Herr Oct 28 '15 at 21:11
  • @DanielHerr Your comment was very helpful. Using the tag and attributes I was able to build a client side drag and drop folder in Chrome that works with my server Side solution. – Dylan Oct 30 '15 at 15:04
  • @Dylan: That's fantastic! Daniel, maybe worth posting that as an answer and letting Dylan know when you have. – T.J. Crowder Oct 30 '15 at 15:09