commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Steffi.Rauschenb...@bahn.de
Subject Antwort: RE: Antwort: FileUpload: Bug in FileUploadBase::parseRequest?
Date Thu, 13 Nov 2003 09:55:17 GMT
Hi Schalk,

I don't quite understand your problem - doesn't this functionality come
with the FileUpload package?
For normal form fields, a DefaultFileItem is created, which contains all
the info of/about the form field, i.e. its name (item.getFieldName()) and
its content (item.getString()). You can assign it to any String variable...
                                                                            
                                                                            
   // Process the uploaded items                                            
   Iterator iter = items.iterator();                                        
   while (iter.hasNext()) {                                                 
       FileItem item = (FileItem) iter.next();                              
                                                                            
       if (item.isFormField()) {                                            
           // Process a regular form field                                  
           String name = item.getFieldName();                               
           String value = item.getString();                                 
           ...                                                              
       } else {                                                             
           processUploadedFile(item);                                       
       }                                                                    
   }                                                                        
                                                                            
                                                                            

You find this code at the Apache FileUpload website:
http://jakarta.apache.org/commons/fileupload/using.html.

Steffi

Steffi Rauschenbach
DB Systems GmbH
Mitarbeiterin Architekturbüro
ITR 51
999 - 16098
____________________________________________________
Internetauftritt der Deutschen Bahn AG >> http://www.bahn.de

---------

Diese E-Mail könnte vertrauliche und/oder rechtlich geschützte
Informationen enthalten. Wenn Sie nicht der richtige Adressat sind oder
diese E-Mail irrtümlich erhalten haben, informieren Sie bitte sofort den
Absender und vernichten Sie diese Mail. Das unerlaubte Kopieren sowie die
unbefugte Weitergabe dieser Mail sind nicht gestattet.

This e-mail may contain confidential and/or privileged information. If you
are not the intended recipient (or have received this e-mail in error)
please notify the sender immediately and destroy this e-mail. Any
unauthorised copying, disclosure or distribution of the material in this
e-mail is strictly forbidden.

----------



---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org


Mime
View raw message