I'm trying to upload a XML file (text.xml) using a simple upload html form, regulary read it as FileItem in the servlet and then get the ACTUAL file (text.xml) so i can print it, save it etc. Is there any educated way to do this simply? some people told me to use FileItem's property getInputStream.. is there any example somewhere? isn't there a shorter way?
thanks
Just use
FileItem#write()
method, exactly as demonstrated in User Guide of Apache Commons FileUpload.That's all.
See also: