• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Sending the file contents from the PC to a remote web server

 
Mahesh Trikannad
Ranch Hand
Posts: 70
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I have a j2EE Web Server on a UNIX machine. I want to write a Web Interface, where the user can select a file from the PC, and then send it onwards to the web container or maybe j2ee container .

Can it be done by just using JSP's or servlets only.

One way I think , is to write a Applet which reads the file, and then have the Applet use a URLConnection to send to the HTTP server.

Thanks

Mahesh
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 34198
340
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Mahesh,
You don't need the applet. There is an HTML tag for uploading files:


Your servlet will then get the file contents as part of the form, which it can process. While this could be done in a JSP, it is best to keep the code out of the JSP and use a servlet.
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64715
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Search for information on "multipart request" for futher information.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic