You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@commons.apache.org by Fire Velocity <fi...@gmail.com> on 2007/06/14 12:46:04 UTC

Error in getting form values

Hi

I am using the commons-fileupload-1.2. I am trying to upload a file in a 
portlet and some other attributes of file using html text box.

In the process action of a portlet i am only getting the file and not 
other form values. Here is code .

            <form action="$actionURL" method="POST" 
enctype="multipart/form-data">
            <table class="formAnswer" style="width: 100%;">
                <tr>
                    <td colspan="2" width="100%" 
class="emphasise"><b>Import</b></td>
                </tr>
                <tr>
                    <td width="20%" class="emphasise">Folder to Import</td>
                    <td width="80%"><input type="text" id="folderPath" 
size="50" value="" readonly /></td>                   
                </tr>   
        <tr>
                    <td width="20%" class="emphasise">Folder to Import</td>
                    <td width="80%"><input type="text" id="folderPath1" 
size="50" value=""/></td>                   
                </tr>               
                <tr>
                    <td width="20%" class="emphasise">File to Import</td>
                    <td width="80%"><input type="file" name="psmlFile"></td>
                </tr>
                <tr>
                    <td colspan="2" width="100%">
                    <input type="submit" value="Import"/>
                    </td>
                </tr>               
            </table>
            </form>

Portlet Code

    DiskFileItemFactory diskFileItemFactory = new DiskFileItemFactory();
            PortletFileUpload portletFileUpload = new 
PortletFileUpload(diskFileItemFactory);
           
            try {
                if(PortletFileUpload.isMultipartContent(actionRequest)){
                Iterator fileIt  = 
portletFileUpload.parseRequest(actionRequest).iterator();

In the itreator, i am only getting the single element

Please Help me .

-- 
Regards & thanks
*Vivek Kumar*

firevelocity@gmail.com <ma...@gmail.com>