aspose file tools*
The moose likes Java in General and the fly likes Upload Excel on desktop to JAVA Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "Upload Excel on desktop to JAVA" Watch "Upload Excel on desktop to JAVA" New topic
Author

Upload Excel on desktop to JAVA

John Molitor
Ranch Hand

Joined: Nov 08, 2004
Posts: 39
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

Joined: May 26, 2003
Posts: 31067
    
232

John,
POI is able to read the Excel file. It doesn't take care of actually uploading the file for you.


[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
subodh gupta
Ranch Hand

Joined: Jul 23, 2007
Posts: 203
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?


http://subodh-gupta.blogspot.com
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42929
    
  68
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

Joined: Nov 08, 2004
Posts: 39
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
Marshal

Joined: Mar 22, 2005
Posts: 42929
    
  68
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

Joined: Nov 08, 2004
Posts: 39
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
Marshal

Joined: Mar 22, 2005
Posts: 42929
    
  68
Yes, yes and yes.
John Molitor
Ranch Hand

Joined: Nov 08, 2004
Posts: 39
Thank you , thank you, and thank you!
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Upload Excel on desktop to JAVA