This week's book giveaway is in the OCMJEA forum. We're giving away four copies of OCM Java EE 6 Enterprise Architect Exam Guide and have Paul Allen & Joseph Bambara on-line! See this thread for details.
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?
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.
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.
Joined: Mar 22, 2005
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?
Joined: Nov 08, 2004
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?