Results 1 to 2 of 2
  1. #1
    sudipanand is offline Member
    Join Date
    Nov 2008
    Posts
    1
    Rep Power
    0

    Default Problem in reading HTML input field while uploading file

    When i use multipart/form-data as my form enctype, then i have problem in reading html input field value.
    i.e. Assume that i have following HTML Form


    <form name="frmFileUpload" enctype="multipart/form-data" method="post">
    <input type="text" name="txtName">
    <input type="file" name="uploadFile">
    <input type="submit" name="butSubmit" value ="Upload">
    </form>


    And, here i am tring to read txtName input field value using follwoing code fragment in my ApplicationController



    request.getParameter("txtName")



    this gives me null value.

    Let me know, how do i read the input field value when Form's enctype type is multipart/form-data

    thanks
    nt anand
    Last edited by sudipanand; 11-26-2008 at 07:24 AM.

  2. #2
    Nicholas Jordan's Avatar
    Nicholas Jordan is offline Senior Member
    Join Date
    Jun 2008
    Location
    Southwest
    Posts
    1,018
    Rep Power
    7

    Default

    getParameter is documented to work on either post data or get data, code above looks correct to me.

    Where is this running?
    Introduction to Programming Using Java.
    Cybercartography: A new theoretical construct proposed by D.R. Fraser Taylor

Similar Threads

  1. uploading a file
    By itssiva in forum Java Servlet
    Replies: 4
    Last Post: 01-16-2009, 10:41 AM
  2. Reading input file into an array
    By littlefire in forum New To Java
    Replies: 6
    Last Post: 10-18-2008, 11:51 PM
  3. File Uploading
    By aaliadhurue in forum Advanced Java
    Replies: 4
    Last Post: 01-16-2008, 06:56 PM
  4. Reading a Field in a Binary File
    By janakiram.attuluri in forum Advanced Java
    Replies: 2
    Last Post: 01-09-2008, 10:47 AM
  5. Problem reading an xml file with AJAX
    By Fiona80 in forum XML
    Replies: 0
    Last Post: 12-17-2007, 08:02 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •