commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Martin Cooper <mart...@apache.org>
Subject Re: [ FileUpload ] Separating standard form fields from upload fields.
Date Tue, 04 Nov 2003 20:18:48 GMT
On Tue, 4 Nov 2003, Schalk wrote:

> Hey All!
>
>
>
> I am using the Jakarta FileUpload package to process some file uploads. I
> have been able to use this package very successfully to upload files from
> forms that only contain file upload fields. I know face a situation where
> one of the fields I need to obtain the value from is not a file upload field
> but a standard text field.
>
>
>
> I have tried just about everything but cannot get the value read in. I need
> to also place the value from the standard form field as well as two files
> into String variables in order to write these to a database. I am using
> getFieldName and getName to get the field and actual value names but when I
> use an if statement to ensure that the correct value is passed to the
> correct variable it comes up with either null or it passes over my if
> statement as if it does not detect a field with a matching name.

The getName() method is used to retrieve the original file name passed
from the browser for a file item. It has nothing to do with the value of
either a file field or a regular form field.

To get the value of a form field, you need to use getString() instead of
getName() (or you can use get() if you want a raw byte array).

--
Martin Cooper


>
>
>
> When I use the getFieldName method and print the result to the System I do
> see the form field names and they do match the values I am using in the if
> statements. You can see the code at:
>
> www.volume4.co.za/Volume4/opensource/fileUpload/createCampaign.java
>
>
>
> If anyone can see where I am going wrong or have any other suggestions
> please let me know. Thanks!!
>
>
>
>
>
> Kind Regards
>
> Schalk Neethling
>
> Web Developer.Designer.Programmer.CEO
>
> Volume4.Development.Multimedia.Branding
>
> emotionalize.conceptualize.visualize.realize
>
> Tel: +27125468436
>
> Fax: +27125468436
>
> email:schalk@volume4.co.za
>
> web: www.volume4.co.za
>
>
>
> This message contains information that is considered to be sensitive or
> confidential and may not be forwarded or diclosed to any other party without
> the permission of the sender. If you received this message in error, please
> notify me immediately so that I can correct and delete the original email.
> Thank you.
>
>
>
>

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