values of input text fields in a html multipart form

前端 未结 4 2279
走了就别回头了
走了就别回头了 2020-12-17 23:47

I use Apache Commons FileUpload in a java server-side app that has a html form with fields :

  1. a destination fied that will be filled with email address of t

4条回答
  •  既然无缘
    2020-12-18 00:13

    So, what I did is to use the instance of fileItem as in:

    Hashtable incoming = new Hashtable();
    fileName = sfu.parseRequest(request);
    
    //iterating over each uploaded file and storing the values of different parameters in the HashTable (incoming)
    
    for(FileItem f:fileName)
                        {
                        incoming.put(f.getFieldName(), f.getString()); 
                        }
    //utilizing that HashTable and getting the value of desired field in the below manner, as in my case i required the value of "permissions" from the jsp page
    
                 for(FileItem f:fileName)
                        {
                            String role= (String)incoming.get("permission"); //as it is a multipart form request, so need to get using this
                        }   
    

    Thanks

提交回复
热议问题