Search code examples
javascripthtmlappletcdcd-rom

Reading data from CD-ROM or DVD using the browser


I am building a webapp for a friend where the user interface should allow users to press a button, and it should somehow upload all of the contents of the CD-ROM/DVD they have inserted, to a server.

I can't really have the standard "Choose file..." of the browser, because there are many different files inside the CD, under many different folders. So I can't have my users choose all the files individually - even if I implement the HTML5 multi-selection, they would still have to navigate through all the sub-folders (there may be several levels). And plus this needs to work on IE8, so multi-selection won't work.

What are my best choices to achieve this? I'm looking for the most transparent solution - downloading a Java applet or an external plugin would be too much of an overhead. Can flash achieve something like this? Flash is still a plugin, but it would be acceptable because it's used in many places and doesn't require "permission to run" as Java applets do.

Thanks


Solution

  • Emm... quite interesting

    Anyway if to lean back on Java Applet solution... I don't think there should be some single API to handle all the mentioned points

    According to your tasks here is some kind of solutions combination...

    I can't really have the standard "Choose file..." of the browser,
    because there are many different files inside the CD, under many
    different folders.

    • If you have a bootable CDs or something... In this case I can advise to use *.iso image file generation of you CD. You can use JIIC lib for this

    • ...and concerning the uploading I can advise using HttpClient
      (on client side) + FileUpload (on servlet side) that will allow to upload ~2Gb weight files... (HttpClient tips) In your CD (case of big file reading) I do recommend override FileBody.writeTo(OutputStream) method to set reading file by chunks support

    • or if your generated file is really huge you can additionally use RandomAccessFile to read/write files by index look at readFully() method

    And one more thing...

    ...So I can't have my users choose all the files individually - even if I implement the HTML5 multi-selection, they would still have to navigate through all the sub-folders (there may be several levels). And plus this needs to work on IE8, so multi-selection won't work.

    • In Java Applet it will work :) If you just need some kind of multi selection (and it is not a bootable CD or something) you can use Swing's JFileChooser for this task. Take a look closer at method like setMultiSelectionEnabled(boolean)...

      • ... concerning the

    '...they would still have to navigate through all the sub-folders (there may be several levels)'

    ... you can simply (not to upload folders) but pre-pack those levels to lets say a zip file to upload the zip file to server (correct me if I am wrong here because the idea of levels is not pretty clear described in your question now) .


    Nevertheless, it would be interesting to know more details because quite rare task as for web apps to upload the whole CDs... As a rule, it is a pretty heavy stuff :S


    Report if that answer was helpful