• 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 all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
  • Tim Cooke
  • Knute Snortum
  • Bear Bibeault
Saloon Keepers:
  • Ron McLeod
  • Tim Moores
  • Stephan van Hulst
  • Piet Souris
  • Ganesh Patekar
  • Frits Walraven
  • Carey Brown
  • Tim Holloway

File Upload and processing

Ranch Hand
Posts: 82
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have the following scenario:
I need to upload a file to the server and then parse the file to create an XML. While parsing i need to do data validation check on the record and if there are errors, I need to populate the same in the XML. So XML will contain

<field-1 err="y">

1) I am planning on rendering a error page by converting the XML with errors are HTML. Is this a good way of doing so? or there are better ways?

2) What is the best utility to do file Upload? I am thinking of Commons File Upload. My file size will not exceed 2-3 MB. Do anyone have servlet based code for the same?

3) What is the best way to reading and parsing the file and generate the XML? I was thinking of substring to parse and JDOM to create XML.

Please let me know if there are some things which i need to take care...

If anyone have code for above... it would be great help..

Thanks in advance...
Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!