Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Uploading and using a file from a web page

 
Tomas Nilson
Ranch Hand
Posts: 33
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello!
I have a web page where I want users to be able to select a file from their harddrive and then upload it to my web server where my Java Bean will parse the spread sheet using POI.
I have already solved the last bit (I have made an application which parses a document from the HD), but how do I upload the file? How do I pass it on to the bean?
Thanks a lot!!
/Tom
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64708
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
To upload a file you need to use a multi-part form and the "file" input element to create the upload controls on your web page.
Then, write a servlet to post this form to that can parse the resulting multi-part request. The servlet can create an instance of your bean and pass the file data to it.
Search these forums for terms like "file upload", "multipart form" and "smart upload" to find lots of topics that discuss this very issue.
hth,
bear
P.S. Further questions on this topic might be better suited to the servlets forum.
 
Toseef Alam
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I want to upload a file from one server to another server. I have a local server where i have a web based application. I want to upload a zip file from this local server to remote server and user doesn't know about that file. User only click a upload button and local server should read that file and submit a rewuest with this file to the remote server.
Please, somebody help me for this. If anybody have any other way to do write me that also.
Thanks,
Toseef
 
Maulin Vasavada
Ranch Hand
Posts: 1873
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi,
it seems u need ftp rather than multi-part request here as u don't want user to see anything.
i guess u can look for 3rd party ftp clients in java on google.
regards
maulin
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic