I am using an html form to be filled in and a servlet to get parameters from the html form. The servlet then uses the Java Mail API to attach the file and send the mail.
The problem I am facing is that when I deploy the application on server on my local machine, the servlet gets the file location from html form, searches it on my local machine, attaches it with mail and sends it. But when I use a server installed and running on different machine on network, the servlet gets the file name from the html form, searches that file on the machine on which server is running (and not on my local machine), and fails to attach the file, and mail sending gets failed. Is there any solution to my problem? The servlet code that I am using is as follows:
[BSouther: Added UBB CODE tags] [ December 22, 2006: Message edited by: Ben Souther ]
The server won't be able to access a file on the client directly. Instead of entering the name of the file, use a file upload element in the HTML form. Then you can use the Commons FileUpload to extract the file contents from the other form data.