How to send data (file and text both) from jsp to servlet

upload JSP 
case 1>> if i am using this  <form enctype="multipart/form-data" the file value is comming on the servlet side
         and other vales are not comming when i am using request.get parameter(....);
case 2>>  if i am using this <form  type="text/html" the "submissionperiod" and "Types" value is comming on the servlet but the file is not comming ........
     How to resolve this issue .  i need to send all the three parameter on single submit and retrieve the parameter values  in my servlet .
please help !
<form enctype="multipart/form-data" name="form" method="post" action="Upload" >
                <table font size="3" style="color:brown;font-family:Arial" >
                <tr>
                <td>Submission Year:    </td>
                <td><select  name="submissionperiod">
                     <option value="">--select--</option>
                     <option value="2000">2000</option>
                     <option value="2001">2001</option>
                     <option value="2002">2002</option>
                     <option value="2003">2003</option>
                     <option value="2004">2004</option>
                     <option value="2005">2005</option>
                     <option value="2006">2006</option>
                     <option value="2007">2007</option>
                     <option value="2008">2008</option>
                     <option value="2009">2009</option>
                </select><label class="Required">*</label></br></td>
                </tr>
                <tr>
                <td>Submission Type :    </td>
                <td><select  name="types"   onchange="showDescription()">
                     <option value="">--select--</option>
                     <option value="CRF">CRF</option>
                     <option value="NIR">NIR</option>
                     <option value="NC">NC</option>
                     <option value="SEF">SEF</option>
                </select><label class="Required">*</label></br></td>
               </tr>
               <tr><td></td><td>
               <div id="divTypeDetails">
                <textarea  id= "subTypeDes" name="subTypeDes"  value=""></textarea></br></br>
              </div>
              </td>
          </table>     
          <td>Select a file (< 100 MB):   </td>
          <td><input id="importFile" name="importFile" type="file"></br>          
          </td>
          <input type="hidden" name="types">
          <input type="hidden" name="submissionperiod">
          <input type="submit" id="submitButton" name="submit" value="Upload" onclick = "checkUploadValidity();"/>
          <input type="button" name=btncancel id=btncancel value="cancel" onclick= "btncancel_click()"/>
</form> 

Both the file and text values are included in the binary inputstream of the request. The parametermap is always empty.
There exist 3rd party API's to parse multipart/form-data streams, such as [Apache Commons FileUpload API|http://commons.apache.org/fileupload].
Read at least the 'User Guide' and 'Frequently Asked Questions' sections.

Similar Messages

  • My iPhone 5S drowned in a rainstorm. How can I retrieve contacts and text messages from iCloud backup onto my iPad mini?

    My iPhone 5S drowned in a rainstorm. How can I retrieve contacts and text messages from iCloud backup onto my iPad mini? There are some contacts on the iPad already but nowhere near all of them. I need to re-enter the contacts manually into an iPhone 4 as it does not support iOS 8.

    Let me get this straight.....You lost your phone.  You never backed it up, either to your computer or to a cloud service.
    How in the world would you expect to get data back?

  • How to create thumbnail images on the fly from JSP or servlet?

    Hi all,
    Iam new to this forum. I need a solution for the problem iam facing in building my site. Ihave groups and briefcase section in my site. I allow users to upload files and pictures.
    When they upload pictures i need to create thumbnail for them on the fly.
    Is there any taglibs or java source to do this from JSP or servlets.
    It would be very greatful if i can get an early answer.
    Please let me know if there is any other forum where i can get better answer, if not here?
    thnx.

    Here is how you can create dynamic images:
    http://developer.java.sun.com/developer/JDCTechTips/2001/tt0821.html#tip2
    However, if you want to create gifs/jpegs and save them to the disk it depends from where you want to create the images. It is different if you are creating from another image or just drawing one from scratch etc.. But in the end you will probably need to use one of the imageencoder classes and write the result to the disk with the file io classes.

  • Import dimension and member via maxl, how to create data file and rule file

    Hi
    I have a task to import dimension and member into Essbase, for project requirement, I have to use text file or spreadsheet file.
    I wonder which format can be imported into Essbase?
    I tried to create them, failed.
    Do you have any samples to help me? dimension file and rule file...
    I search a lot in http://gerardnico.com/wiki/epm/essbase/dimension_build#about , but there are no samples.
    Thanks in advance...
    Best regards,
    Samantha

    import database Sample.Basic data from data_file 'C:\TEMP\GENREF.txt' using rules_file 'C:\TEMP\GENREF.rul' on error append to 'C:\TEMP\logs\dimbuild.log';Here issue is not with rulefile but in reading the rule file.
    I hope rule file is in the database directory (By default it will get saved there only)
    Try with the below command
    import database Sample.Basic data from data_file 'C:\TEMP\GENREF.txt' using server rules_file 'GENREF' on error append to 'C:\TEMP\logs\dimbuild.log';
    Rule file also had one issue
    Market, Product, Measures, Jan, Feb, Mar, Apr, May, Jun, Jul, Aug, Sep, Oct, Nov, DecHere I am seeing only four dimensions from the Sample.Basic database
    Scenario is missing. So define Actual (Scenario Dimension member) in the rule file header definition.
    All dimensions must be identified to parse one data file with rule file.
    PS: Naming (GENREF) is also irrelevant if you are loading data. It is apt for dim load.

  • How to read .dat file and display on a chart.

    Hello, I am very new to labeled and am looking for some guidance on how to display data from a file onto a chart. I have registered the appropriate data plug in (Yokogawa_DAT) however when I try to use the file viewer VI it is still not recognized by LabVIEW. I have included a sample of the data which includes 2 channels plus time stamping and color information etc. The data is produced by a Yokogawa VR100 recorder that is no longer supported, and therefore the native viewing software is impossible to get. Unfortunately my time is limited and learning all the ins and outs of LabVIEW is going to take a good deal of it, I am hoping someone will be able to point me in the right direction to learn the basics of what I am after without having to learn LabVIEW in its entirety. Many Thanks!
    Attachments:
    D110514.zip ‏3 KB

    Yes, Brand new set of data, exactly as it comes off the recorder. Including config files etc.
    Attachments:
    Yokogawa.zip ‏8 KB

  • How to export Date book and Address book from Palm Desktop to Apple iCal and Address Book?

    I have my calendar information and addresses stored in Palm Desktop date book and address book, respectively. I am running Palm Desktop 4.2.1. Everytime I try to export the date book or address book to my desktop using the vCal format, the Palm desktop crashes. My goal is to export all my data from Palm Desktop to iCal and Address Book on the Apple OS (10.6.1). Does anyone have any advice as to how I can do this or do I just have to start from scratch and manually enter the data from Palm Desktop to Apple iCal and Address Book? I looked at the Missing Sync software, but I don't think this will do the trick. The Genius Bar at the Apple Store didn't offer any solutions either. Any advice would be greatly appreciated. Thanks.
    Post relates to: Palm V

    Hello tay8000m and welcome to the Palm forums.
     Have you tried running the "Repair Disk Permissions" command in Apple's Disk Utility application yet?  Launch Disk Utility, select "Macintosh HD" from the left side of the window, and then click the "Repair Disk Permissions" button.
     After the utility has run, try launching Palm Desktop again and then exporting your data as vCard or iCal files.  If the exports aren't working for you, you can always export the data as comma separated values (.csv) file and then import that into the Apple apps you want to use.
    Alan G

  • How to store a file and refer it from another file using the Binary cache?

    Hello,
    I think it's a long shot but I thought I will give it a try.
    I am creating an excel file from an xml String using the Web Dynpro Binary cache.
    The problem is that when columns with numbers are involved an extra #agg column is being added by the excel "flattener" which is in charge of rendering the excel file from the xml String.
    The only way to override this excel feature is to supply your own XSLT and reference it from the XML. Now, since I am not using an actual filesystem but the Web Dynpro Binary cache, is it possible to use this cache in order to store there the xslt and refer it later from an XML?
    Roy

    Hi,
    Just found out this.. See if you can make use of it..
    getPublicCachedWebResource(byte[] webResource, WDWebResourceType resourceType, WDScopeType scopeType, WDDeployableObjectPart deployableObjectpart, String key)
    <i>          returns a IWDCachedWebResource, <b>which is saved directly to the WDDeployableObject directory.</b></i>
    you can make WDDeployableObject as your component and point the reference to the component folder.. Since you are specifying a scope type.. it shoukd be deleted after the scope defined...
    Lemme know if this works..:)

  • How to change date format and time zone from the client.

    In order to change time zone, you need to go Administration-> Access Management (Step 1), and select your name on the right (Step 2).
    Then select Edit tab at the bottom of the screen, and change both Time Zone and Regional Setting.

    Thanks for sharing, Agnes.

  • How to use  the same channel to send a file and messages to the server

    I'm trying to develop a simple program that will send and receive files from the server and in the same time I need to communicate with the server through the messages
    I'm using TCP Socket
    my problem is
    I have only one channel
    so, I have no option, either I can use it for sending the file itself or sending the message .. but not both !
    my question is : How can I use the same channel for sending and receiving (file & message)
    I would appreciate for any clue or hint
    best

    kajbj wrote:
    kmarwani wrote:
    Thanks for reply
    yes, that what I'm thinking to do
    but, in case of sending binary file, if I attached a flag on its header, will it corrupt the file ?
    bestThe other end would of course need to decode the messages that you get, and only write the "data" part to the file.Thanks
    I'm gonna try to hard-code what you suggest and i will post what happen with me here
    even though I'm not sure how can I add header to a binary file and remove it from the file at other end. (coz I read it as stream and send as array without touching its contents)
    this how I'm sending the file
    ConnSocket = CSocket.accept();
    ToClient = new DataOutputStream(ConnSocket.getOutputStream());
    File myFile = new File("abc.jpg");
    FileInputStream myFileInStream = new FileInputStream(myFile);
    BufferedInputStream mybuffInStream = new BufferedInputStream(myFileInStream);
    myBytArray = new byte[(int) myFile.length()];
    mybuffInStream.read(myBytArray, 0, myBytArray.length);
    ToClient.write(myBytArray, 0, myBytArray.length);
    ToClient.flush();
    myFileInStream.close();best

  • How to send audio files as attachments?There is no attachment option in mail and no share option in MUSIC

    How to send audio files as attachments?There is no attachment option in mail and no share option in MUSIC

    i have some voice samples in Music file .how to share those files? or plz tel me where to store the voice samples

  • How to create new .dat file and its contents?

    Hi There
    Can anybody let me know the procedure of how to create new .ctl or .dat file to load data to tables.
    i working on 2day dba chapter 8. it shows me how to creat table and use .dat file to load data. but doesnot giv any clue how new .dat file and its contents can be created. please help.
    thanks in advance.

    Thanks for ur help
    I ve created txt file in notepad and saved it as dat file. tried to load that data thru Enterprise manager. used load data from User files everything went well and job was showing suceeded but dont know why that data is not showing in the table. i ve tried it now for three four times. used right table and pathe but dont know. has anybody got idea why that ll be?
    Thanks

  • How to send automatic mail and put attache file on batch file ?

    how to send automatic mail and put attache file on batch file ?
    START MAILTO:[email protected]?SUBJECT=PHONE%CALL^&BODY=Testing

    Hi,
    Do you want to use a batch file to create new email message (including recipients, subject and email body) with attachments? If so, I'd recommend you post your question in the Scripting Guys forum for further assistance:
    https://social.technet.microsoft.com/Forums/scriptcenter/en-US/home?forum=ITCG
    The reason why we recommend posting appropriately is you will get the most qualified pool of respondents, and other partners who read the forums regularly can either share their knowledge or learn from your interaction with us. Thank you for your understanding.
    Please feel free to let me know if I've misunderstood something.
    Regards,
    Steve Fan
    TechNet Community Support
    It's recommended to download and install
    Configuration Analyzer Tool (OffCAT), which is developed by Microsoft Support teams. Once the tool is installed, you can run it at any time to scan for hundreds of known issues in Office
    programs.
    Please remember to mark the replies as answers if they help, and unmark the answers if they provide no help. If you have feedback for TechNet Support, contact
    [email protected]

  • How to edit xml file particular value. and how to send xml file over ip address 192.168.2.10 using ftp

    how to edit xml file particular value. and how to send xml file over ip address 192.168.2.10 device using ftp through Ethernet

    Hello
    For using FTP function in LabVIEW, I recommend you to check this document: FTP Basics
    Also, take a look at FTP Browser.vi, which is available at the Example Finder.
    To edit a XML file, try to use VIs in XML palette. Maybe Write to XML.vi helps you.
    Post your current VI if possible.
    Regards
    Mondoni

  • How to design SQL server data file and log file growth

    how to design SQL DB data file and log file growth- SQL server 2012
    if my data file is having 10 GB sizze and log file is having 5 GB size
    what should be the size in MB (not in %) of autogrowth. based on what we have to determine the ideal size of file auto growth.

    It's very difficult to give a definitive answer on this. Best principal is to size your database correctly in advance so that you never have to autogrow, of course in reality that isn't always practical.
    The setting you use is really dictated by the expected growth in your files. Given that the size is relatively small why not set it to 1gb on the datafile(s) and 512mb on the log file? The important thing is to monitor it on an on-going basis to see if that's
    the appropriate amount.
    One thing you should do is enable instant file initialization by granting the service account Perform Volume Maintenance tasks in group policy. This will allow the data files to grow quickly when required, details here:
    https://technet.microsoft.com/en-us/library/ms175935%28v=sql.105%29.aspx?f=255&MSPPError=-2147217396
    Also, it possible to query the default trace to find autogrowth events, if you wanted you could write an alert/sql job based on this 
    SELECT
    [DatabaseName],
    [FileName],
    [SPID],
    [Duration],
    [StartTime],
    [EndTime],
    CASE [EventClass]
    WHEN 92 THEN 'Data'
    WHEN 93 THEN 'Log' END
    FROM sys.fn_trace_gettable('c:\path\to\trace.trc', DEFAULT)
    WHERE
    EventClass IN (92,93)
    hope that helps

  • How to create pdf files with text field data

    how to create pdf files with text field data

    That looks like it should work, but it doesn't.
    I opened the PDF I had created from Word in Acrobat (X Pro). Went to File > Properties. Selected "Change Settings". I then enabled "Restrict editing...", set a password, set "Printing Allowed" to "none", "Changes Allowed" to "none", and ensured that "Enable copying of text..." was disabled.
    I saved the PDF file, closed Acrobat, opened the PDF in Reader, and I was still able to select text and graphical objects.
    I reopened the PDF in Acrobat, and the document summart still shows everything as allowed. When I click on "show details" (from File > Properties) it shows the correct settings.
    Any ideas?

Maybe you are looking for

  • Credit management how to block amount on particular sales order

    hi, Client want to block amount on sales order. If customer is having credit limit of 100000 n there are 3 sales order , sales order 1 amount is 50000,sales order 2 amount is 30000 and sales order 3 amount is 40000... Now customer is coming n saying

  • Images with Transparency

    I am wondering if anyone can tell me the best way to supply a designer with an image for Final Cut that will hold its transparent background when imported? The designer claims that the psd, tiff and jpg with alpha channels that I sent over will only

  • Sharepoint and SSRS error

    Hi I am getting the below error after deploying SSRS report into sharepoint An error has occurred during report processing. (rsProcessingAborted) Cannot create a connection to data source 'DataSource1'. (rsErrorOpeningConnection) For more information

  • Starting and stopping a loop

    I am importing a list of 10,000 emails into memory and then comparing them to a database which holds over 400,000 records. It doesnt take long for the <cfquery> to time out. I know there must be a way to loop thru 20 or so, then stop, then loop thru

  • IPhone 3G software change

    Hey guys, I have an iPhone 3G and 4G, because I find the 3G really slow but I don't wanna waste it... is there anyway that I could change it's hardware or processor, etc so it could run faster?