• Post Reply Bookmark Topic Watch Topic
  • New Topic

Retrieving file at server side  RSS feed

 
Saurav Chatterjee
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I am facing an interesting problem.

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?

Regards,
Saurav
 
Jesper de Jong
Java Cowboy
Sheriff
Posts: 16047
88
Android IntelliJ IDE Java Scala Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Are you writing a kind of webmail application?

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.

To receive the file on the server side, you can use a library like Apache Jakarta Commons FileUpload.
 
Saurav Chatterjee
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.

Regards,
Saurav
 
Chetan Parekh
Ranch Hand
Posts: 3640
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Saurabh,

Have you used applet / swing in your desktop application?

Have you got any solution for this problem?
 
jiju ka
Ranch Hand
Posts: 308
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

<input type=""> will not do as the client is a desktop client.

Can you provide more information about the client application? What do you mean by desktop client? A web browser is a desktop client. So please be specific.

Is the client application made of java? Can you modify it?
Currently how is the client application hooking to the EJB's at the server?

Can the user type in text at the client side as part of mail?
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!