Question

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

Was it helpful?

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

OTHER TIPS

I've used fine uploader for some time and it works quite fine for full folders. It is full html/javascript.

you will have to add "webkitdirectory and "mozdirectory" to the <input>, and also maintaining directory structure can be hard, but not insurmontable. You have to use the onUpload callback, then gain access to the filereference object, which should have a 'relativePath' that you can use add to the uploader's post data for the server to use.

The user will have to use firefox or chrome only, and choose their directory (or drag it!).

Hope this helps.

For Chrome you can depend on HTML5 File System API. You can read the contents of the directory and sub directory also. But I am not sure whether there is any solution for doing the same for IE.

This link might be helpful for you http://www.html5rocks.com/en/tutorials/file/filesystem/ http://www.w3.org/TR/file-system-api/

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top