If you use the html file-input the upload is done automatically for you. Your browser will create a multipart http request and send the file data to the server. This is the only way of getting the data to the server if you only use a simple http client and a Webserver.
It's not possible for the webserver to access your local filesystem if you only pass a file url (eg. c:\file.txt). The webserver can never get to that file.
Ok, now we have come to that understanding. The only way to go is using <input type="file">. What do we need on the server side? You can not just upload a file to any webserver of course. The server has to know what to do with that content. You will have to parse the multipart request and process all files that have been uploaded in the request. For this you can use FileUpload in the Jakarta commons project.
Using FileUpload You do have to have a Java Servlet/JSP container in order to use this of course. (eg.
Tomcat)
I hope this is clear for you?
Ah yes, if you do not want to manually select the file (you said you do not want to use the <input type="file">
you may try to set the value (using javascript, or on the generated html) and make it invisible using CSS. Just an idea that comes to mind.
[ July 05, 2005: Message edited by: Manuel Moons ]