commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Adam Pelletier" <ad...@moebius-solutions.com>
Subject Re: FileUpload Parameter Handling
Date Thu, 07 Oct 2004 19:06:04 GMT
No, this is just a plain servlet.  Another guy wrote that regular form 
params show up in in the DiskFileUpload.

When you iterate through the values, you can test to see
if they are form fields with "isFormField"


Example:......................................
DiskFileUpload upload = new DiskFileUpload();
List           files  = upload.parseRequest(request);
Iterator       it             = files.iterator();

while(it.hasNext()){
   FileItem item = (FileItem)it.next();
   if(item.isFormField()){....


But that still breaks my architecture - although I can get to that 
architecture if I have to.

Adam

----- Original Message ----- 
From: "Michael McGrady" <mike@michaelmcgrady.com>
To: "Jakarta Commons Users List" <commons-user@jakarta.apache.org>
Sent: Thursday, October 07, 2004 11:45 AM
Subject: Re: FileUpload Parameter Handling


> Are you using Struts, Adam?
>
> Michael McGrady
>
> Adam Pelletier wrote:
>
>>I'm using commons-fileupload-1.0.jar.
>>
>>I'm trying to upload a file using enctype="multipart/form-data".
>>
>>However, I'm also passing a hidden form input element with an ID stuck in 
>>it.  This ID is critical for the state of the servlet.  Oddly, when I use 
>>the enctype="multipart/form-data", my HttpServletRequest no longer seems 
>>to contain the parameters usually accessible by req.getParameter("ID");. 
>>In the debugger I see that the parameter hashtable is empty.  As a test I 
>>remove enctype="multipart/form-data" from the form.  The parameters then 
>>show up properly in the parameter map, but now the file is not accessible.
>>Is there a way to utilize both the file uploading capability and still 
>>have access to the parameter list as it comes in as a HttpServletRequest?
>>
>>Thanks in advance.
>>Adam
>>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: commons-user-help@jakarta.apache.org
>
> 



---------------------------------------------------------------------
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