This week's book giveaway is in the Cloud/Virtualizaton forum.
We're giving away four copies of Mesos in Action and have Roger Ignazio on-line!
See this thread for details.
Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Upload Excel on desktop to JAVA

 
John Molitor
Ranch Hand
Posts: 39
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a situation where a user fills in an excel spreadsheet and then we need to upload it from their PC into our java welboigc app running on AIX. I have heard commons file upload bantered about, requiring changing the xls to a csv document (don't want the user to have to do this). I also have heard POI mentioned as well, but not sure if POI can upload from a PC to my web app. Any suggestions?
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 34410
346
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
John,
POI is able to read the Excel file. It doesn't take care of actually uploading the file for you.
 
subodh gupta
Ranch Hand
Posts: 203
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Are you talking about extracting data or uploading as blob?

I think nothing is required in uploading a file you can take the path of the file and just read through any stream.

What you want do after uploading it?
 
Ulf Dittmer
Rancher
Posts: 42967
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can use Commons FileUpload for the server side, and Commons HttpClient for the client side. As was mentioned above, any file can be used - no conversion is necessary. See http://faq.javaranch.com/java/FileUpload for more detail.
 
John Molitor
Ranch Hand
Posts: 39
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am looking to do two things.
1. My webapp has an upload link, which when clicked, the user supplies a file name. Then they click upload, and I want my app to pick up the file from the specified location, which in most cases is the user's PC.
2. Once I have the excel file uploaded, I need to process the data from the file inot my application, for storage in a database.

Thanks for all the responses, but I am still not clear on what I need to do.
 
Ulf Dittmer
Rancher
Posts: 42967
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
For #1 you'll need a servlet that uses the FileUpload library.

For #2 you'll need either Jakarta POI or the jExcelApi library.

What do you have so far?
 
John Molitor
Ranch Hand
Posts: 39
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Currently, we have a process that uses the commons-file upload library to pull a .cvs file into our webapp. There is currently a parser that was written to parse the .csv file. Can fileupload upload an .xls file, and then use poi to reconstruct the file and process the data in the cells by row?
 
Ulf Dittmer
Rancher
Posts: 42967
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes, yes and yes.
 
John Molitor
Ranch Hand
Posts: 39
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you , thank you, and thank you!
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic