I have a desktop application that prompts a user for file names and then using regex manipulates and displays the sorted/selected data/lines..
I want to do the same thing in web app... Ask user for file name/names and then manipulate data using some POJO class and then display the result....
How can i achieve that if possible..
1.Is it possible to directly access file on client machine?
2.If not, than can I read only line by line from selected file and then direct that input for
manipulation to some other class(POJO) and then display result using JSP..
I don't think that you can access files on the client machine. You will have to upload the file on the server and then manipulate the file. I don't think that applets can help either cause they run in the sandbox which will not allow you to access client files for security reason. So IMHO, file uploading is the solution...
Well I don't think you can upload multiple files at once. At least not through file upload box. For that you will have to do some advance work. For example orkut allows you to upload multiple photos. That is a flash which let's you select multiple files. Similarly I think there must be more ways of doing this. But I don't know any of them so let's see if anyone has some idea about this...
I have also seen those multiple file select option in geicites.com upload... but its a great pain...
Webstart is the only option I suppose...Never tried it....But this might be a good oppurtunity..
muktesh tripathi wrote:I have also seen those multiple file select option in geicites.com upload... but its a great pain...
Webstart is the only option I suppose...
More important than the pain you may feel is the pain your users may feel. I can't imagine a situation where selecting 4 files sequentially is more painful than the combined pain of your users having to live with a WebStart application, and you having to support it (and them). I regret to say this, but client-side Java in a browser is painful, for the most part.
What I meant was that I require particular kinds of files to be manipulated...These files are generated as some kind of logs or from input stream from some port connected to .....they are generated 4 times a day in user specified folder..
now the user gives me path to those files and I give him output based on the files content after manipulation....
suppose the file is in c:\A\B\D\E\Folder... so to select the four files the user has to follow full path four times ....
Joined: Mar 22, 2005
Could you make sure that the file/directory structure is well-known in advance (and is not changing), so that you can code that knowledge into the application? That way, the user only has to select the root directory wherein all files/subdirectories are located.
muktesh tripathi wrote:so to select the four files the user has to follow full path four times ....
In most browsers, the file upload dialog will remember the most recent folder.
Joined: Nov 20, 2007
In most browsers, the file upload dialog will remember the most recent folder."
I think this will be of great help....Is there any way of specifying the default path for file upload directory on the client side..refer quoted text below
"Could you make sure that the file/directory structure is well-known in advance (and is not changing), so that you can code that knowledge into the application? That way, the user only has to select the root directory wherein all files/subdirectories are located."
Joined: Oct 08, 2006
No, that´s not possible with HTML.
subject: Reading and manipulating file content on client machine