• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Uploading and using a file from a web page

 
Ranch Hand
Posts: 33
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 1873
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Thank you my well lotioned goddess! Here, have my favorite tiny ad!
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic