I need to upload a file to a file on a unix machine and process that file using some additional parameters. One way of doing this is to have a web application using which I can upload the file to the unix system and which also accepts the additional parameters. However my unix machine does not have any webservers and we are not planning on having one unless absolutely necessary. The alternative is to upload the file using WinSCP, and run the java code that processes the file from the console. Are there any other alternatives? I thought that running a Swing FileChooser might be the answer, but not anymore (1. FileChooser would let me choose files on the UNIX box and not on my local machine 2. To get Swing to work I have to have X11 installed) Any suggestion would be appreciated!
P.S. At a previous job we did this with email. The clients would email files as attachments and the email server would store the messages in the file system. A daemon detected new messages, fetched the attachments, and processed them.
FTP would be cleaner, but these clients were very technically-challenged and getting them to use email was about as technical as they could get.
Joined: Oct 08, 2002
The problem with using the FTP server is that the users also need to pass some additional parameters. Thanks for your suggestions - now I know I am not missing any obvious solutions and that the webserver route might be the way to go after all.
We do that by first uploading the file to the FTP server, then using the FTP "RCMD" command to run the program which processes the file.
It takes a bit of configuration to get the path set up on the server, and so on. And you should be careful with security if your FTP server is exposed to the Internet (allowing anybody in the world to potentially execute arbitrary commands on your FTP server would be dangerous).
Joined: Oct 08, 2002
I am on the lookout for a solution that would appeal to "technology challenged" clients Thanks for your your tips!
There are some Java libraries for SSH which might work well if the Unix box runs OpenSSH, uploading the file with SCP or SFTP, then running the command through the shell. Have a look at JSch and Trilead.