how to get another parameter with file upload

hi,I know how to upload a file with common file-upload. IS it possible to get another text field value with this? But i can not retrieve another value.is there anybody can help me? what will be the solution of this? Please help me.With regardsBina
[282 byte] By [bina_jatnoa] at [2007-10-2 23:47:45]
# 1
a solution i can give you is to separate the form for file elements and textfields
jgalacambraa at 2007-7-14 16:32:34 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 2
hi,may be i know what u r saying but i want to upload an image to server & retrive some text field's value with common file-upload. I f u know about this please help me or is there any way to do this? With regardsbina
bina_jatnoa at 2007-7-14 16:32:34 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 3

Copy pasted from [url http://jakarta.apache.org/commons/fileupload/using.html]commons file upload help page[/url]

// Process the uploaded items

Iterator iter = items.iterator();

while (iter.hasNext()) {

FileItem item = (FileItem) iter.next();

if (item.isFormField()) {

processFormField(item);

} else {

processUploadedFile(item);

}

}

For a regular form field, you will most likely be interested only in the name of the item, and its String value. As you might expect, accessing these is very simple.

// Process a regular form field

if (item.isFormField()) {

String name = item.getFieldName();

String value = item.getString();

...

}

ram.

Madathil_Prasada at 2007-7-14 16:32:34 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 4

im not familiar with commons-file upload by apache but the two html forms i mention can have separate actions.. with those two action one action can retrieve values from the textfields and the other from the file attributes.. example:

form1 action=servlet1

textfield1

form2 action=servlet2

file1

submit the two forms simultaneously

like

form1.submit();

form2.submit();

use ordinary button

then on servlet1 retrieve value from textfield

on servlet2 retrive value from file1

jgalacambraa at 2007-7-14 16:32:35 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 5
hi,Can u give me sample code for this? With regardsbina
bina_jatnoa at 2007-7-14 16:32:35 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...