Problem : We have an ejb component that sends mail messages to different clients. Now we have to insert the add attachment feature.
Approach : For this purpose we must have the file content at server side. That can be done by using ftp or other protocol from the server side itself as we can't force the client to upload their file to a particular location at the server. These things must be kept transparent to the user. But what if the client has no service(ftp etc.) running on his machine?
Please let me know the solution. Is the requirement technically feasable? Is there anything wrong in our approach?
It's not completely clear what you want exactly, but maybe this will be useful: If you want to upload a file from a client to a server via a web application, you can use an <input type="file" ...> control in your web application.
Sorry for not being precise. Let me try to explain the scenarion.
I have an ear file that contains an ejb and few other classes. The ejb has a method that is used to send mail. Now I have implement the runtime attachment feature i.e the user will give a file name from his local file system and that will get attached along with the mail. Since the ejb will get executed at server jvm, I need to transfer the file from user's local file system to the server. Now, the point is how it can be done without adding anything to the client code? One approach can be to ftp the file to a predefined location at the serverr. Another may be to serialize the file content and then send it, however I am not sure how this can be done. Another approach(although extremely bad) could have been that the server will pull the file from the client's machine using ftp. But that needs ftpserver on the client side which cannot be guarranted. Is there any other approach? <input type=""> will not do as the client is a desktop client.