Anthony
Anthony

Reputation: 35988

Is there a way to read contents of a directory from web app

I have a web application built on the JVM. In this application the users are able to upload files. I read the contents of the file and do "something" with it.

In addition to this, I would like to give option to the users to put in a directory path. This directory path will be read by the application and the directory will be scanned for all relevant files (.CSV). And each will be processed.

Questions

Upvotes: 0

Views: 796

Answers (1)

AlexR
AlexR

Reputation: 115378

You cannot access file system of user machine from pure web application. This task can be implemented using trusted applet or java application executed via java web start or trusted flash component or other native component (browser plugin).

Applets are almost obsolete and require JVM on client side. Java web start still requires JVM. All signed components (java based, flash, native code) require user approval.

I think that better and more modern way is to use a great feature of HTML 5 that allows not navigation to specific location on disk (that was possible since HTML 1.0) but also selecting a full directory.

Take a look on the following discussion for details: Does HTML5 allow drag-drop upload of folders or a folder tree?

Upvotes: 1

Related Questions