Post form data

Hello world,
I need your help guys. I want to know how to post the data of a java application form
which take a name and surname and post the data when the post button is pressed to a server. This is similar to html form, but the difference it that am using a desktop java application and I have a server that will receive the data when submitted.
But my problem is that I don't know how to post the data as the form and the server are not in the same place and this is not a html form.
it should be in the following format :
http://www.mysite.com/form.php?name=bolala&surname=hello.From the url, bolala is the name entered and hello is the surname entered into the form.
Please guys help me
Cheers.

That's a GET, not a POST. So which bit can't you do?sorry, I made a mistake! ignore the url above.
I want the data to be sent to the server. the bit i can't understand it how do I post the data?
Thansk for your reply.

Similar Messages

  • ASP Classic - post form data without form

    I have to send our account password and user entered form
    data to a page (which I can't modify). I don't want to use the Get
    method and I don't want to put our password into a hidden field. I
    would like to have the user fill out the form, which submits back
    to the page where I add my password field value via ASP, then send
    all of that data to another page via post.
    To further clarify, we are using a service and to add user
    data I have to also supply our account name and password.

    Get it from the database and when you send it make sure its
    sent as
    unencrypted text. Its all the rage...
    <%= Clinton Gallagher
    NET csgallagher AT metromilwaukee.com
    URL
    http://clintongallagher.metromilwaukee.com/
    "jasonacook" <[email protected]> wrote in
    message
    news:f6321t$s9j$[email protected]..
    >I have to send our account password and user entered form
    data to a page
    >(which
    > I can't modify). I don't want to use the Get method and
    I don't want to
    > put our
    > password into a hidden field. I would like to have the
    user fill out the
    > form,
    > which submits back to the page where I add my password
    field value via
    > ASP,
    > then send all of that data to another page via post.
    > To further clarify, we are using a service and to add
    user data I have to
    > also
    > supply our account name and password.
    >

  • IE11 can't post form data to specific frame or window dialog opened via window.open()

    Hello,
    Form POST targeting to specific frame or dialog popped up via window.open() no longer works in IE11.
    It worked fine in IE10 and all previous versions of IE.
    Please see screenshot attached with simple test that reproduces this problem.
    Direct Link to screenshot:
    http://173.231.98.44/cgi/TestFolder/IE_11_widow_frame_targeting_BUG.jpg
    Direct link to simple test page demonstrating this problem:
    http://173.231.98.44/cgi/TestFolder/page2.asp
    Note: IE11 doesn't report any errors, doesn't complain about anything, even when debugged via F12 developer tools. The only thing it complained initially was missing doc type declaration on top of page, but even after adding doc type definition, problem still
    persists, makes no difference.
    I tested this on fresh install of Windows 2012R2 while testing our web application with the new IE11.
    I believe doing this on Windows 8.1 with IE11 will result in same bug/problem.
    Our web application uses a technique whereby it launches a popup window via call to window.open(), passing blank URL and specifying a name for the new window. It then does a from post targeting the name of new dialog.
    In IE11 this functionality has been broken and no longer works.
    Problem is that IE11, instead of posting form to the newly created dialog, it launches a new instance of IE and then loads the requested form in this new instance of IE, while the dialog launched via window.open() remains on screen and is empty. If user repeats
    launching same form post request (via button click for example), IE 11 keeps creating new empty dialogs and new IE instance for every form post executed. This totally breaks our application because we use many so called "wizards" that encapsulate
    specific functionality in separate web page launched in a popup window.
    Another related problem is that if a dialog is launched with window.open(), the java script code in the dialog can not target the parent frame that opened the dialog anymore. In our application, when a dialog is closed, it typically needs to trigger a refresh
    of a specific frame within the parent window (again targeted by name) to reflect saved/updated info that user entered in the popup dialog. The result is that we can't refresh the parent frame after the pop up dialog closes. Instead, IE11 launches
    a new instance of IE (not just a tab, but a whole new instance) and loads the parent frame in it.
    The problem seems to be caused by broken frame name targeting mechanism in IE11.
    Note that we force IE to compatibility mode 5, but even without specifying any compatibility, the problem remains.
    Typical java script to reproduce this is:
    <input type="button" onClick="Popup(this.form);" name="btn2" value="Popup Dialog">
    function Popup(f){
        window.open("","MyNewDialogName","width=200,height=150");
        f.action = "page3.asp";
        f.target = "MyNewDialogName";
        f.submit();
    Expected: IE11 should correctly post form to and load targeted page in the newly popped up dialog, without opening new IE instance and new tab. Repeatedly posting form to existing popup window should reuse that window, not keep on launching more popup windows
    and then more IE instances.
    Steps to reproduce the problem (include URL if applicable):
    URL with sample page: http://173.231.98.44/cgi/TestFolder/page2.asp
    1) Create page1.htm: <html><body>display "I'm in a popup window now ..."</body></html>
    2) Create page2.htm with a button and onclick() event calling function to open dialog, and do form POST targeting new dialog calling page1.htm, like below.
    <input type="button" onClick="Popup(this.form);" name="btn2" value="Popup Dialog"> function Popup(f){
        window.open("","MyNewDialogName","width=200,height=150");
        f.action = "page1.asp";
        f.target = "MyNewDialogName";
        f.submit();
    3) Open IE11, navigate to page2.htm, click the "Popup Dialog" dialog button. IE 11 will popup the new dialog, but then it will also launch new instance of IE11 and display the page1.htm in it, instead of in the popup dialog.
    Has anyone else encountered this problem?
    Any insight or help is appreciated.
    Regards
    Peter

    the default action of <input type="button" is submit. Note also that the default type of <button> elements is 'submit' also.
    add a return false to the onclick inline event handler (which constructs the form submit attribues) to cancel the default form.submit behavior.
    form elements have a target value with which you can specify the name window into which you want the form to open in.
    <form action="process.aspx" target="popup">
    you can use the window.open method with a query uri to achieve the same outcome.
    window.open('process.aspx?s=search+term&amp;foo=bar','popup',{features})
    the outcomes of all scripted windows are affected by
    your IE Popup blocker and tabbed browsing settings
    which in turn is affected by your IE Security zone settings (for popup blocking handling)
    and the settings of any third-party popup blocker you may have installed and enabled... it may not necessarily be visible on your browser toolbar.
    The first step in troubleshooting web browser issues is to test in no-addons mode.
    Use the Developer Tool to find out what documentMode the test page is opening in on your system. On Modal/Modeless popup windows use the f12 key to display the Developer tool positioned on the contentWindow.
    Use File>Properties to find out what IE Security zone it maps to... there is a security setting to prevent navigation into zones of lower integrity.
    Rob^_^

  • How to open a new web browser after posting form data to web server ?

    Hi Experts,
    I am using NetBeans 6.5 and I am able to post data to web server using httpconnect and i am also able to open default browser on my mobile using platformRequest(url).
    But what I am trying to do is that: i want to post data (not get method) to my ASP web page and then I want my web page opens in my mobile default browser keeping my post data. Shortly I want to open my ASP page in a new browser passing some parameters from midlet using POST method (not GET)
    Thanks for all kind help...

    [url http://ostermiller.org/utils/Browser.java.html]This code seems to use a temporary page that uses javascript to open a new window. Haven't tried it though.

  • Acrobat form with server side submit, posting blank data

    Read more
    Acrobat form with server side submit, posting blank data,
    thanh xả tràn
    I have a PDF form which gets submitted to the server using a submit (server-side) button. The data is then received in XML format by a ColdFusion component which does some validation and stores it into the database.
    This PDF form is usually filled in by our clients using Adobe Reader 8 or below. While most of the times(and I mean like 96-97% of the times) everything goes well, at times we receive blank data into our database!! This renders couple of other features in our application useless as they try to parse an XML which does not exist.
    I do believe that this is not a problem at the ColdFusion side because all it does is trim(ToString(toBinary(GetHttpRequestData().content))).
    Does anyone has a clue as to why the data will be lost upon form submission?? I have done a lot of googling around it but in vain!

    There is an outside chance someone is just playing with you and submitting a blank form. Not uncommon if someone is not too familiar with forms.

  • Resend Form Data on Huffington Post

    In the past few weeks, I get this annoying message every 15 seconds, whenever I go to www.huffingtonpost.com:
    "This web page is being redirected to a new location. Would you like to resend the form data you have typed to the new location?"
    I have not entered any form data.
    This message started appearing after my office installed new web content filters The message does not happen in Internet Explorer, nor does it occur on my home laptop using Firefox. My office IT folks claim their content filter is not the problem (their usual reply to such inquiries). I would like to know if there is a setting in Firefox that can fix this issue.

    Application Basics
    Name: Firefox
    Version: 31.0
    User Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:31.0) Gecko/20100101 Firefox/31.0
    Crash Reports for the Last 3 Days
    All Crash Reports
    Extensions
    Name: Adobe Acrobat - Create PDF
    Version: 1.2
    Enabled: false
    ID: [email protected]
    Graphics
    Adapter Description: NVIDIA Quadro NVS 290
    Adapter Drivers: nvd3dumx,nvwgf2umx,nvwgf2umx nvd3dum,nvwgf2um,nvwgf2um
    Adapter RAM: 256
    Device ID: 0x042f
    DirectWrite Enabled: false (6.2.9200.16571)
    Driver Date: 1-18-2013
    Driver Version: 9.18.13.1106
    GPU #2 Active: false
    GPU Accelerated Windows: 0/1 Basic
    Vendor ID: 0x10de
    WebGL Renderer: Google Inc. -- ANGLE (NVIDIA Quadro NVS 290 Direct3D9Ex vs_3_0 ps_3_0)
    windowLayerManagerRemote: false
    AzureCanvasBackend: skia
    AzureContentBackend: cairo
    AzureFallbackCanvasBackend: cairo
    AzureSkiaAccelerated: 0
    Important Modified Preferences
    browser.cache.disk.capacity: 358400
    browser.cache.disk.smart_size_cached_value: 358400
    browser.cache.disk.smart_size.first_run: false
    browser.cache.disk.smart_size.use_old_max: false
    browser.cache.frecency_experiment: 4
    browser.places.smartBookmarksVersion: 7
    browser.sessionstore.upgradeBackup.latestBuildID: 20140716183446
    browser.startup.homepage_override.buildID: 20140716183446
    browser.startup.homepage_override.mstone: 31.0
    dom.mozApps.used: true
    extensions.lastAppVersion: 31.0
    gfx.direct2d.disabled: true
    gfx.direct3d.last_used_feature_level_idx: 1
    layers.acceleration.disabled: true
    network.cookie.prefsMigrated: true
    places.history.expiration.transient_current_max_pages: 104858
    plugin.disable_full_page_plugin_for_types: application/pdf
    plugin.importedState: true
    privacy.sanitize.migrateFx3Prefs: true
    JavaScript
    Incremental GC: true
    Accessibility
    Activated: false
    Prevent Accessibility: 0
    Library Versions
    NSPR
    Expected minimum version: 4.10.6
    Version in use: 4.10.6
    NSS
    Expected minimum version: 3.16.2 Basic ECC
    Version in use: 3.16.2 Basic ECC
    NSSSMIME
    Expected minimum version: 3.16.2 Basic ECC
    Version in use: 3.16.2 Basic ECC
    NSSSSL
    Expected minimum version: 3.16.2 Basic ECC
    Version in use: 3.16.2 Basic ECC
    NSSUTIL
    Expected minimum version: 3.16.2
    Version in use: 3.16.2
    Experimental Features
    ---------------------

  • Mutipart/form data in request

    Hi to All,
    I need to get the form bean object values in filter class from the request for doing some validation.
    For get request there is no problem to get the data from the request. But for the 'multipart/form-data'
    after reading the data in filter class , it is not able to retrieve in the action class. But I am using 'RequestWrapper'
    then the normal request datas get losed. I need to get the data from both POST and GET.
    Thanks in adavance ..

    Sunil,
    <u><b>Resstructuring Infocube</b></u>.
    With this function, you can fill an InfoCube with requests that have already been loaded into a BW, or into another InfoCube. You can, therefore, create a new InfoCube in BW, and use data that has already been loaded successfully into the PSA or into the IDOCs to fill the new InfoCube.
    In the InfoCube tree, choose the InfoCube that you want to fill > right click > Administrate.
    Choose Reconstruct > Selection, and, using the selection options, determine the requests that you want to use to reconstruct the InfoCube.
    Select the corresponding requests from the list, and choose Reconstruct.
    <b>NOTE:</b>
    This function is particularly useful, if you are loading deltas, that is, data that you cannot request again from the source system.
    Let me know if you need any further clarifications.
    Thanks
    Ramu
    <u></u><u></u><u></u><i></i>

  • Problem with ENCTYPE='multipart/form-data'

    In my program I want to upload a file along with other details.
    I've dowloaded org.apache.commons.fileupload.* jar files and everything works fine only if I give
    <INPUT TYPE='file' NAME='file1'>
    i.e the file is uploaded
    But if I add any other field it becomes blank
    Title : <INPUT id=text1 maxlength="30" name=GHN1 >
    the value of GHN1 becomes blank. what cud be the problem.
    Here is my program
    <%@ page contentType="text/html; charset=iso-8859-1" language="java" import="java.sql.*,java.text.SimpleDateFormat.*,java.text.ParseException.*,java.text.*,java.text.DateFormat.*,java.util.*,java.util.Date.*,com.gh.db.*,org.apache.commons.fileupload.*,org.apache.commons.fileupload.servlet.ServletFileUpload,org.apache.commons.fileupload.disk.DiskFileItemFactory,org.apache.commons.io.FilenameUtils,java.io.*,java.io.File,java.lang.Exception" errorPage="Error.jsp" %>
    <%
    String TACm1="";
    String TASid,Nme="",Cm2="",GHN1="",GHN2="",GHN3="",Sid="";
    TACm1=((request.getParameter("TAIdCombo"))!=null?(request.getParameter("TAIdCombo")):"");
    DBconnection TApool = DBconnection.getInstance();
    Connection con2 = TApool.getConnection();
    con2.setAutoCommit(false);
    Statement TAst1 = con2.createStatement();
    ResultSet TArs1 = null,rs2=null,rs1=null;
    Cm2=((request.getParameter("TMIdCombo2"))!=null?(request.getParameter("TMIdCombo2")):"");
    java.util.Date d1;
    java.sql.Date d2;
    SimpleDateFormat format=new SimpleDateFormat("dd/MM/yyyy");
    %>
    <html>
    <head>
    <TITLE>Guest Houses of DOS</TITLE>
    </head>
    <%@ include file="StdValidations.js" %>
    <%@ page buffer="1094kb"%>
    <script Language="JavaScript">
    </script>
    <body onload="window.history.forward(1);">
    <FORM ENCTYPE='multipart/form-data' name="GHInfoDetails1"
         method='POST' action="GHInfoDetails1.jsp">'<br><br><br>
    <center>
    <%      
         String LoginName= "";
         String Name= "";
         String SectionName= "";
         try
              LoginName = session.getAttribute("LoginName").toString();
              Name = session.getAttribute("Name").toString();
              SectionName = session.getAttribute("SectionName").toString();     
         catch(NullPointerException npe)
              %>
              <jsp:forward page="LoginHere.jsp" >
              <jsp:param name="SessionMode" value="Session Expired try again to log on" />
              </jsp:forward>
              <%
    %>
    <%
              GHN1 = request.getParameter("GHN1");
              if (GHN1 == null) GHN1 = "";
              GHN2 = request.getParameter("GHN2");
              if (GHN2 == null) GHN2 = "";
              GHN3 = request.getParameter("GHN3");
              if (GHN3 == null) GHN3 = "";
    %>
         <table width="100%" bgcolor="#F7EDF7">
              <tr >
              <td align="center">
                   <img src="Images/Title2.gif">
              </td>
              </tr>
              </table>
              <table width="100%" bgcolor="#F7EDF7">
              <tr>
              <td >
                   <b><font face="Times New Roman, Times, serif" color="#402180" size="+1">Logged in as:  <%= Name %></font></b>
              </td>
              <td >
                   <b><font face="Comic Sans MS" color="#402180" size="+1">Other Details of Guest House</font></b>
              </td>
              <td align="right">
                   <b><font face="Times New Roman, Times, serif" color="#402180" size="+1">Logout</font></b>
              </td>
              </tr>
         </table>
              <table width="100%" bgcolor="#B6C7E5" border="1">
              <tr>
              <td valign="top">
              </br>
              <p><img src="Images/bullet.gif"><b><font face="Times New Roman, Times, serif" color="#402180" size="+0">Defining Guest House Information</font></b></p>
              <p><img src="Images/bullet.gif"><b><font face="Times New Roman, Times, serif" color="#402180" size="+0">Cancelling Guest House Information</font></b></p>
              </td>
              <td align="left"></br>
                   <table width="100%" bgcolor="#B6C7E5">
                   <tr>
                                  <td width="60%" align="right"></br>
                                  <P >Category :  <select onChange="TAMAssignCombo2();" name="TMIdCombo2" style="WIDTH: 120px" >
                                                                <option value="-">Select</option>
                                                                <% try
                                                                     PreparedStatement ps6=con2.prepareStatement("Select CategoryName from TableCategory order by CategoryName");
                                                                     rs2 = ps6.executeQuery();     
                                                                     while(rs2.next())
                                                                          Sid=rs2.getString(1);
                                                                               %>
                                                                                    <option value = "<% out.write(Sid); %>"><% out.write(Sid); %></option>
                                                                               <%
                                                                catch(Exception e)
                                                                     e.printStackTrace();
                                                                %>
                                                                     <Script>alert("Exception Occured : <%= e %>");</Script>
                                                                <%
                                                                %>
                                                 </select>
                                  </P>
                   </td>
                   </tr>
                   <tr align="center">
                   <td>
                        Title :     <INPUT id=text1 maxlength="30" name=GHN1 onKeyPress="if (((event.keyCode > 32) && (event.keyCode < 48)) || ((event.keyCode > 57) && (event.keyCode < 65)) || ((event.keyCode > 90) && (event.keyCode < 97))) event.returnValue=false;">
                   </td>
                   </tr>
                   <tr align="center">
                   <td>
                        Reference No :     <INPUT id=text1 maxlength="100" name=GHN2 onKeyPress="if (((event.keyCode > 32) && (event.keyCode < 48)) || ((event.keyCode > 57) && (event.keyCode < 65)) || ((event.keyCode > 90) && (event.keyCode < 97))) event.returnValue=false;">
                   </td>
                   </tr>
                   <tr align="center">
                   <td>
                        Date :     <INPUT id=text1 maxlength="30" name=GHN3 >
                   </td>
                   </tr>
                   <tr align="center">
                   <td >
                   </br>
                                           File Name:        <INPUT TYPE='file' NAME='file1'></p>
                   </td></tr>
                   <tr>
                   <td align="center">
                                                         <INPUT TYPE='submit' VALUE='Submit' ></br>
                   <b><font face="Times New Roman, Times, serif" color="#402180" size="3">(Information like distance,direction from central places such as Railway station, Airport, Bus Terminal....etc can be added in a file of windows format(such as word, pdf...) and can be uploaded through this screen. This will be displayed for the ISRO Guests.</font></b>)
                   </td>
                   </tr>
                   </table>
              </td>
              </tr>
              </table>
              <table width="100%" bgcolor="#B6C7E5">
              <tr>
              <td align="center">
                   </br>
                   <img src="Images/Home.jpg">
              </td>
              </tr>
              </table>     
    <% if (ServletFileUpload.isMultipartContent(request))
         GHN1 = request.getParameter("GHN1");
         if (GHN1 == null) GHN1 = "";
         GHN2 = request.getParameter("GHN2");
         if (GHN2 == null) GHN2 = "";
         GHN3 = request.getParameter("GHN3");
         if (GHN3 == null) GHN3 = "";
         DiskFileUpload fileUpload = new DiskFileUpload();
         List list = null;
         try
              list = fileUpload.parseRequest(request);
         catch(FileUploadException ex)
              throw new ServletException("Wrapped",ex);
         Iterator iter = list.iterator();
         while (iter.hasNext())
         FileItem item = (FileItem) iter.next();
         if (!item.isFormField())
              File itemFile = new File(item.getName());
              Nme=itemFile.getName();
              %>
              <%
              File destDir = new File(getServletContext().getRealPath("/")
                                       +"stored");
         if(!destDir.exists())
              destDir.mkdirs();
         File destFile = new File(getServletContext().getRealPath("/")
                                       +"stored"+File.separator+itemFile.getName());
         try
              item.write(destFile);
         catch(Exception ex)
              //throw new ServletException("Wrapped",ex);
         TACm1=SectionName;
         %><script>alert("<%=GHN1%>");</script><%
         try
              PreparedStatement ps26=     con2.prepareStatement("select CategoryNo from TableCategory where CategoryName=?");
              ps26.setString(1,Cm2);
              rs1=ps26.executeQuery();
              while (rs1.next())
                   PreparedStatement ps16=con2.prepareStatement("inset into TableMetaData (CategoryNo,Title,RefernceNo,Date,FileName) values(?,?,?,?,?)");
                   ps16.setString(1,rs1.getString(1));
                   ps16.setString(2,GHN1);
                   ps16.setString(3,GHN2);
                   d1=format.parse(GHN3);
                   d2=new java.sql.Date(d1.getTime());     
                   ps16.setDate(4,d2);
                   ps16.setString(5,Nme);
                   int NoOfRows=ps16.executeUpdate();
                   con2.commit();
         catch(Exception e)
              e.printStackTrace();
         %>
                             <script> alert("Error : <%= e %>"); </script>
         <%
    %>
    <%
              if (TAst1 != null) TAst1.close();
                                  if (con2 != null)
                                       con2.rollback();
                                       con2.setAutoCommit(true);
                                       TApool.returnConnection(con2);
              %>
    <input name="HomePage" type="hidden">
    </form>
    </body>
    </html>

    This article is worth reading: http://balusc.blogspot.com/2007/11/multipartfilter.html

  • Problem with transfering unicode form data in MULTIPART/FORM-DATA

    HI experts,
    I have this web based multilingual application. Page 1(form6.jsp) is basic registeration form with 5 fields and one image upload to the server. Page 2(verify.jsp) is another jsp page for verification of UTF data entered in page 1.
    page 2 (verify.jsp) also uses a bean called (verify.java) for picking up values. page 3(insertEntry.jsp) is the page for inserting that data into the Database and uses a bean called (logicbean.java).
    Now, the problem im facing here is that if i use multipart/form-data, the unicode text filled in page1 is shown as garbage when its is transfered to page2 and displayed on page2. It is all gibberish. But if i do not use multipart/form-data, the unicode text transfered from page1 to page2 is displayed perfectly on page2.Im using devenagari(UTF) language for filling in details.
    // form6.jsp
    <%@ page language="java" pageEncoding="UTF-8"%>
    <%@ page import="java.util.*,java.text.*" %>
    <%@ page import="com.oreilly.servlet.*" %>
    <%
    request.setCharacterEncoding("UTF-8");
    %>
    <HTML>
    <HEAD>
    <TITLE>
    <%=session.getValue("main.title")%>
    </TITLE>
    </HEAD>
    <h1><center><%=session.getValue("main.head")%><Center>
    <BODY background="brown.bmp">
    <form name=form6 action="verify.jsp" method="post" enctype="multipart/form-data">
    <center>
    <font>
    <table border=1>
    <tr>
    <td colspan=2><center><img src="asok.bmp"></center>
    </tr>
    <tr>
    <td >
    <b>1.)<%=session.getValue("main.ec")%></b>
    </td>
    <td></td>
    </tr>
    <tr>
    <td align="right"><b><%=session.getValue("main.ecname")%></b>&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp<input type="text" name="votername"></td>
    <td></td>
    </tr>
    <tr>
    <td align="right"> <b><%=session.getValue("main.ecsurname")%></b>&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp<input type="text" name="votersurname"></td>
    <td></td>
    </tr>
    <tr>
    <td align="left"><b>2.)<%=session.getValue("main.rel")%></b>&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp
    <select name="relation" onchange="if(this.selectedIndex!=0){this.form.texthiddenrelation.value=this.options[this.selectedIndex].value}" size="1">
                                       <option>Choose</option>
    <option value="father">Father</option>
    <option value="mother">Mother</option>
    <option value="husband">Husband</option>
    </select>
    <input type="hidden" name="texthiddenrelation" />
    </td>
    </tr>
    <tr>
    <td align="right"><b><%=session.getValue("main.relname")%></b>&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp<input type="text" name="parentname">
    <td></td>
    </tr>
    <tr>
    <td align="right"><b><%=session.getValue("main.relsurname")%>&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp</b><input type="text" name="parentsurname">
    <td></td>
    </tr>
    <tr>
    <td align="right"><b>3.)<%=session.getValue("main.sex")%></b>&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp
    &nbsp&nbsp&nbsp&nbsp&nbsp&nbsp
    <select name="sex" onchange="if(this.selectedIndex!=0){this.form.texthiddensex.value=this.options[this.selectedIndex].value}" size="1">
                                            <option>Choose</option>
                                            <option value="male">Male</option>
    <option value="female">Female</option>
    <option value="other">Other</option>
    </select>
    <input type="hidden" name="texthiddensex" /> </td>
    <td align="right"><b><%=session.getValue("form6.image")%><input type ="file" name=pic1 onchange={this.form.pic.value=this.form.pic1.value}><input type= hidden name=pic> </b></td>
    </tr>
    <tr>
    <td colspan=2><b>4.)<%=session.getValue("main.age")%></b><input type="text" name="age">
    </td>
    </tr>
    <tr>
    <td><b>5.)<%=session.getValue("main.dob")%></b>
    <td><b><%=session.getValue("main.dobday")%></b> <select name="cmbday">
    <option value="1"> 1 </option>
    <option value="2">2</option>
    <option value="3">3</option>
    <option value="4">4</option>
    <option value="5">5</option>
    <option value="6">6</option>
    <option value="7">7</option>
    <option value="8">8</option>
    <option value="9">10</option>
    <option value="10">11</option>
    <option value="11">12</option>
    <option value="12">13</option>
    <option value="13">14</option>
    <option value="14">15</option>
    <option value="15">16</option>
    <option value="16">17</option>
    <option value="17">18</option>
    <option value="18">19</option>
    <option value="19">20</option>
    <option value="20">21</option>
    <option value="21">22</option>
    <option value="22">23</option>
    <option value="23">24</option>
    <option value="24">25</option>
    <option value="25">26</option>
    <option value="26">27</option>
    <option value="28">28</option>
    <option value="29">29</option>
    <option value="30">30</option>
    <option value="31">31</option>
    </select>
    <b><%=session.getValue("main.dobmonth")%></b><select name="cmbmonth">
    <option value="jan">JAN</option>
    <option value="feb">FEB</option>
    <option value="mar">MAR</option>
    <option value="apr">APR</option>
    <option value="may">MAY</option>
    <option value="jun">JUN</option>
    <option value="jul">JUL</option>
    <option value="aug">AUG</option>
    <option value="sep">SEPT</option>
    <option value="oct">OCT</option>
    <option value="nov">NOV</option>
    <option value="dec">DEC</option>
    </select>
    <b><%=session.getValue("main.dobyear")%></b> <select name="cmbyear" onchange="if(this.form.cmbday.selectedIndex!=0 && this.form.cmbmonth.selectedIndex!=0 && this.form.cmbyear.selectedIndex!=0){this.form.mergedage.value=this.form.cmbday.options[this.form.cmbday.selectedIndex].value +' '+this.form.cmbmonth.options[this.form.cmbmonth.selectedIndex].text +' '+ this.form.cmbyear.options[this.form.cmbmonth.selectedIndex].value}" size="1">
    <option value="1970">1970</option>
    <option value="1971">1971</option>
    <option value="1972">1972</option>
    <option value="1973">1973</option>
    <option value="1974">1974</option>
    <option value="1975">1975</option>
    <option value="1976">1976</option>
    <option value="1977">1977</option>
    <option value="1978">1978</option>
    <option value="1979">1979</option>
    <option value="1980">1980</option>
    <option value="1981">1981</option>
    <option value="1982">1982</option>
    <option value="1983">1983</option>
    <option value="1984">1984</option>
    <option value="1985">1985</option>
    <option value="1986">1986</option>
    <option value="1987">1987</option>
    <option value="1988">1988</option>
    <option value="1989">1989</option>
    <option value="1990">1990</option>
    <option>
    </select>
    <input type="hidden" name="mergedage">
    </tr>
    <tr>
    <td colspan=2><b>6.)<%=session.getValue("main.add")%></b>
    </tr>
    <tr>
    <td align="right"><b><%=session.getValue("main.addline1")%></b>&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp<input type="text" name="address1" value=""></td>
    <td><b><%=session.getValue("main.addstate")%></b>&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp<input type="text" name="state"></td>
    </tr>
    <tr>
    <td align="right"><b><%=session.getValue("main.addline2")%></b>&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp<input type="text" name="address2" onChange="this.form.finaladdress.value=this.form.address1.value + ';' + this.value;"> <input type="hidden" name="finaladdress"> </td>
    <td><b><%=session.getValue("main.addcity")%>&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp</b><input type="text" name="city"></td>
    </tr>
    <tr>
    <td align="right"> <b><%=session.getValue("main.addpin")%></b>&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp<input type="text" name="pincode">
    <td></td>
    </tr>
    <tr>
    <td ><b>7.)<%=session.getValue("main.const")%></b> <input type="text" name="constituency">
    <td ><b>8.)<%=session.getValue("main.id")%></b> &nbsp&nbsp<input type="text" name="refno">
    </tr>
    <tr>
    <td colspan="2"><center><input type="reset" name="reset" value="<%=session.getValue("button.reset")%>">&nbsp&nbsp<input type=submit name=Submit value="<%=session.getValue("button.submit")%>"></center></td>
    </tr>
    <tr>
    <td>
    </td>
    </tr>
    </form>
    </font>
    </BODY>
    </HTML>
    // verify.jsp
    <%@ page language="java" pageEncoding="UTF-8"%>
    <jsp:useBean id="verify" class="pack.verify" scope="request"/>
    <%@ page import="com.oreilly.servlet.*" %>
    <%@ page import="java.util.*,java.text.*" %>
    <%!
    MultipartRequest mp;
    // ParameterParser pp;
    %>
    <!-- Perform the actions on the bean. -->
    <%
    //pp.setCharacterEncoding("utf-8");
    %>
    <%
    try
    mp = new MultipartRequest(request, "d:/Files");
    out.println("DONE");
    /* Set the request object.*/
    /* The request object is implicitly available in the JSP page.*/
    verify.setRequest(mp);
    /* Insert the employee data into the database.*/
    verify.verifyEntry();
    //verify.setscope();
    /* Run the query to retrieve the employee data from the database.*/
    //logicbean.runQuery();
    catch (Exception e)
    System.out.println(e.getMessage());
    %>
    <HTML>
    <HEAD>
    <LINK href="theme/Master.css" rel="stylesheet" type="text/css">
    <TITLE>
    </TITLE>
    </HEAD>
    <BODY background="brown.bmp">
    <form name=form6 action="insertEntry.jsp" method="POST">
    <center>
    <table border=3>
    <tr>
    <td colspan=2><center><img src="asok.bmp"></center>
    </tr>
    <tr>
    <td >
    <b>1.)<%=session.getValue("main.ec")%></b>
    </td>
    <td rowspan=3>
    <image src="<%=verify.getpic()%>" width="85" hieght="85">
    </td>
    </tr>
    <tr>
    <td > &nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp<b><%=session.getValue("main.ecname")%></b> <%=verify.getvotername()%>&nbsp&nbsp<input type="hidden" value= "<%=verify.getvotername()%>" name="votername"></td>
    </tr>
    <tr >
    <td> &nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp<b><%=session.getValue("main.ecsurname")%></b><%=verify.getvotersurname()%>
    <input type="hidden" value= "<%=verify.getvotersurname()%>" name="votersurname"></td>
    </tr>
    <tr>
    <td ><b>2.)<%=session.getValue("main.rel")%></b><input type="hidden" value= "<%=verify.getvoterrelation()%>" name="texthiddenrelation"></td>
    <td><%=verify.getvoterrelation()%></td>
    </tr>
    <tr>
    <td >&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp<b><%=session.getValue("main.relname")%></b>&nbsp&nbsp&nbsp <input type="hidden" value= "<%=verify.getparentname()%>" name="parentname"></td>
    <td><%=verify.getparentname()%></td>
    </tr>
    <tr>
    <td >&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp<b><%=session.getValue("main.relsurname")%></b><input type="hidden" value= "<%=verify.getparentsurname()%>" name="parentsurname"></td>
    <td><%=verify.getparentsurname()%></td>
    </tr>
    <tr>
    <td><b>3.)<%=session.getValue("main.sex")%></b><input type="hidden" value= "<%=verify.getsex()%>" name="texthiddensex"></td>
    <td><%=verify.getsex()%></td>
    </tr>
    <tr>
    <td ><b>4.)<%=session.getValue("main.age")%></B><input type="hidden" value= "<%=verify.getage()%>" name="age"></td>
    <td><%=verify.getage()%></td>
    </tr>
    <tr>
    <td><b>5.)<%=session.getValue("main.dob")%></b> <input type="hidden" value= "<%=verify.getdob()%>" name="mergedage"></td>
    <td> <%=verify.getdob()%></td>
    </tr>
    <tr>
    <td colspan=2><b>
    6.)<b><%=session.getValue("main.add")%></b></td>
    </tr>
    <tr>
    <td> &nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp<b><%=session.getValue("verify.add")%></b><input type="hidden" value= "<%=verify.getadderess()%>" name="finaladdress"> </td>
    <td><%=verify.getadderess()%></td>
    </tr>
    <tr>
    <td >&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp<b><%=session.getValue("main.addpin")%></b><input type="hidden" value= "<%=verify.getpin()%>" name="pincode"></td>
    <td><%=verify.getpin()%></td>
    </tr>
    <tr>
    <td>&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp<b><%=session.getValue("main.addstate")%></b><input type="hidden" value= "<%=verify.getstate()%>" name="state"></td>
    <td><%=verify.getstate()%></td>
    </tr>
    <tr>
    <td><b>&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp<%=session.getValue("main.addcity")%></b><input type="hidden" value= "<%=verify.getcity()%>" name="city"></td>
    <td><%=verify.getcity()%></td>
    </tr>
    <tr>
    <td><b>7.)<%=session.getValue("main.const")%></b> <input type="hidden" value= "<%=verify.getconst()%>" name="constituency"></td>
    <td><%=verify.getconst()%></td>
    </tr>
    <tr>
    <td><b>8.)<%=session.getValue("main.id")%></b> <input type="hidden" value= "<%=verify.getrefno()%>" name="refno"></td>
    <td><%=verify.getrefno()%></td>
    </tr>
    <tr>
    <td colspan="2"><center><INPUT TYPE="button" VALUE="<%=session.getValue("ie.back")%>" onClick="history.go(-1)">
    <input type=submit name=Submit value="<%=session.getValue("button.submit")%>"></center><input type="hidden" value= "<%=verify.getpic()%>" name="pic"></td>
    </tr>
    </form>
    </BODY>
    </HTML>
    //verify.java
    package pack;
    import java.lang.*;
    import java.sql.*;
    import java.util.*;
    import javax.servlet.*;
    import javax.servlet.http.*;
    import com.oreilly.servlet.*;
    import com.oreilly.servlet.ParameterParser.*;
    * @author Administrator
    * To change this generated comment edit the template variable "typecomment":
    * Window>Preferences>Java>Templates.
    * To enable and disable the creation of type comments go to
    * Window>Preferences>Java>Code Generation.
    public class verify {
    String votername = "";
    String votersurname = "";
    String texthiddenrelation="";
    String parentname = "";
    String parentsurname = "";
    String gender = "";
    String texthiddensex="";
    String age = "";
    String dob = "";
    String mergedage="";
    String address = "";
    String finaladdress="";
    String pincode = "";
    String state = "";
    String city = "";
    String constituency = "";
    String refno = "";
    MultipartRequest request = null;
    Connection dbConn = null;
    ParameterParser pp;
    private String voternameParam;
    * Set the request object. This is used for getting parameters.
    public void setRequest(MultipartRequest request)
    this.request = request;
    public void verifyEntry()
    throws Exception
    /* Connect to the database.*/
    //pp.setCharacterEncoding("utf-8");
    //String nameParam = request.getParameter("name");
    MultipartRequest mp;
    System.out.println("connected to db2 through insertemployee");
    /* Get all the parameters from the calling HTML form.*/
    String voternameParam = request.getParameter("votername");
    System.out.println("the votername is " + request.getParameter("votername"));
    System.out.println(voternameParam);
    String votersurnameParam = request.getParameter("votersurname");
    System.out.println("the votersurname is " + request.getParameter("votersurname"));
    String hiddenrelationParam = request.getParameter("texthiddenrelation");
    System.out.println("the relation is " + request.getParameter("texthiddenrelation"));
    String parentnameParam = request.getParameter("parentname");
    System.out.println("the parentname is " + request.getParameter("parentname"));
    String parentsurnameParam = request.getParameter("parentsurname");
    System.out.println("the parentsurname is " + request.getParameter("parentsurname"));
    String ageParam = request.getParameter("age");
    System.out.println("the age is " + request.getParameter("age"));
    String mergedageParam = request.getParameter("mergedage");
    System.out.println("the mergedage is " + request.getParameter("mergedage"));
    String hiddensexParam = request.getParameter("texthiddensex");
    System.out.println("the hiddensex is " + request.getParameter("texthiddensex"));
    //String dobParam = request.getParameter("dob");
    //System.out.println("the dob is " + request.getParameter("dob"));
    String finaladdressParam = request.getParameter("finaladdress");
    System.out.println("the finaladdress is " + request.getParameter("finaladdress"));
    String pincodeParam = request.getParameter("pincode");
    System.out.println("the pincode is " + request.getParameter("pincode"));
    String stateParam = request.getParameter("state");
    System.out.println("the state is " + request.getParameter("state"));
    String cityParam = request.getParameter("city");
    System.out.println("the city is " + request.getParameter("city"));
    String constituencyParam = request.getParameter("constituency");
    System.out.println("the constituency is " + request.getParameter("constituency"));
    String refnoParam = request.getParameter("refno");
    System.out.println("the refno is " + request.getParameter("refno"));
    System.out.println("encoding = " + System.getProperty("file.encoding"));
    public String getvotername()
    return request.getParameter("votername");
    public String getvotersurname()
    return request.getParameter("votersurname");
    public String getvoterrelation()
    return request.getParameter("texthiddenrelation");
    public String getparentname()
    return request.getParameter("parentname");
    public String getparentsurname()
    return request.getParameter("parentsurname");
    public String getage()
    return request.getParameter("age");
    public String getsex()
    return request.getParameter("texthiddensex");
    public String getadderess()
    return request.getParameter("finaladdress");
    public String getpin()
    return request.getParameter("pincode");
    public String getstate()
    return request.getParameter("state");
    public String getcity()
    return request.getParameter("city");
    public String getconst()
    return request.getParameter("constituency");
    public String getrefno()
    return request.getParameter("refno");
    public String getdob()
    return request.getParameter("mergedage");
    public String getpic()
    //String a=request.getParameter("pic");
    //a=a.substring(a.lastIndexOf("/")+1);
    //System.out.print("Java path is "+a);     
    //Enumeration enum=request.getFileNames();
    //while(enum.hasMoreElements())
    //     String abc=(String)enum.nextElement();
    //     System.out.print("Java the path is "+abc);     
    return request.getParameter("pic");
    String votername1;
    //public void setScope()
    //request.setAttribute("votername1" ,voternameParam );
    //insertEntry.jsp
    <jsp:useBean id="logicbean" class="pack.logicbean" scope="request"/>
    <%@ page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
    <%@ page import="java.util.*,java.text.*" %>
    <%@ page import="com.oreilly.servlet.*" %>
    <%
    request.setCharacterEncoding("UTF-8");
    %>
    <!-- Perform the actions on the bean. -->
    <%
    request.setCharacterEncoding("UTF-8");
    %>
    <%
    try
    /* Set the request object.*/
    /* The request object is implicitly available in the JSP page.*/
    logicbean.setRequest(request);
    //MultiPartRequest mp=MultiPartRequest(request,"E:\Files");
    /* Insert the employee data into the database.*/
    logicbean.insertEntry();
    /* Run the query to retrieve the employee data from the database.*/
    //logicbean.runQueryInsert();
    catch (Exception e)
    System.out.println(e.getMessage());
    %>
    <HTML>
    <HEAD>
    <TITLE>
    Insert Record
    </TITLE>
    </HEAD>
    <BODY background="brown.bmp">
    <center><H2><%=session.getValue("ie.label")%>
    </H2>
    <font face = "Devanagari MT for IBM" size = +2>
    <b><%=session.getValue("ie.sd")%>|<%=session.getValue("ie.home")%></b>
    </font>
    </center>
    </BODY>
    </HTML>
    I have narrowed down the problem to the point where i understand that the "request.getParameter()" function for multipart is not able to understand or read UTF data properly. The out.println prints garbage from this function on the console. im using WAS
    plz help
    thanx in advance
    caffaine

    hi,
    To solve your problem Servlet Filters
    FILTER PROGRAM
    ===============
    package filters;
    import java.io.IOException;
    import javax.servlet.Filter;
    import javax.servlet.FilterChain;
    import javax.servlet.FilterConfig;
    import javax.servlet.ServletException;
    import javax.servlet.ServletRequest;
    import javax.servlet.ServletResponse;
    import javax.servlet.UnavailableException;
    public class SetCharacterEncodingFilter implements Filter {
    // ----------------------------------------------------- Instance Variables
    * The default character encoding to set for requests that pass through
    * this filter.
    protected String encoding = null;
    * The filter configuration object we are associated with. If this value
    * is null, this filter instance is not currently configured.
    protected FilterConfig filterConfig = null;
    * Should a character encoding specified by the client be ignored?
    protected boolean ignore = true;
    // --------------------------------------------------------- Public Methods
    * Take this filter out of service.
    public void destroy() {
    this.encoding = null;
    this.filterConfig = null;
    * Select and set (if specified) the character encoding to be used to
    * interpret request parameters for this request.
    * @param request The servlet request we are processing
    * @param result The servlet response we are creating
    * @param chain The filter chain we are processing
    * @exception IOException if an input/output error occurs
    * @exception ServletException if a servlet error occurs
    public void doFilter(ServletRequest request, ServletResponse response,
    FilterChain chain)
         throws IOException, ServletException {
    // Conditionally select and set the character encoding to be used
    if (ignore || (request.getCharacterEncoding() == null)) {
    String encoding = selectEncoding(request);
    if (encoding != null)
    request.setCharacterEncoding(encoding);
         // Pass control on to the next filter
    chain.doFilter(request, response);
    * Place this filter into service.
    * @param filterConfig The filter configuration object
    public void init(FilterConfig filterConfig) throws ServletException {
         this.filterConfig = filterConfig;
    this.encoding = filterConfig.getInitParameter("encoding");
    String value = filterConfig.getInitParameter("ignore");
    if (value == null)
    this.ignore = true;
    else if (value.equalsIgnoreCase("true"))
    this.ignore = true;
    else if (value.equalsIgnoreCase("yes"))
    this.ignore = true;
    else
    this.ignore = false;
    // ------------------------------------------------------ Protected Methods
    * Select an appropriate character encoding to be used, based on the
    * characteristics of the current request and/or filter initialization
    * parameters. If no character encoding should be set, return
    * <code>null</code>.
    * <p>
    * The default implementation unconditionally returns the value configured
    * by the <strong>encoding</strong> initialization parameter for this
    * filter.
    * @param request The servlet request we are processing
    protected String selectEncoding(ServletRequest request) {
    return (this.encoding);
    web-xml entry
    +++++++++++
    <filter>     
         <filter-name>Set Character Encoding</filter-name>
    <filter-class>filters.SetCharacterEncodingFilter</filter-class>
              <init-param>
    <param-name>encoding</param-name>
    <param-value>UTF-8</param-value>
    </init-param>
    </filter>
    <filter-mapping>
    <filter-name>Set Character Encoding</filter-name>
    <url-pattern>*.jsp</url-pattern>
    </filter-mapping>

  • Multipart/form-data using HTTPService, sending a binary file and some text in the same request.

    Hi There,
             I am new to FLEX and also new to writing a client for a web service.
    My question is more about flex (Flash builder 4.5) APIs, what APIs to use.
    I want to access a web service, that's published here.
    https://build.phonegap.com/docs/write_api
    here is the description of webservice
    ===========
    1) I have to do a post on POST https://build.phonegap.com/api/v1/apps
    2) content type has to be "multipart/form-data"
    3) JSON bodies of requests are expected to have the name 'data'
      data will be someting like this
    'data={"title":"API V1 App","package":"com.alunny.apiv1","version":"0.1.0","create_method":"file"}'
    4) include a zip file in the multipart body of your post, with the parameter name 'file'.
    ===========
    I want to make a 'multipart/form-data' Post and send
    one string and one zip file.
    My first question to self was If i send both string + binary data in the body ...
    how will server understand where string end and where zip file starts?
    Then read on W3.org( http://www.w3.org/TR/html401/interact/forms.html#h-17.13.4.2 )
    How is text + binary data can be sent through "multipart/form-data" post requst.
    there has to be some boundries.
    After this I read and example in flex and  tried following it.
    http://codeio.wordpress.com/2010/04/03/5-minutes-on-adobe-flex-mimic-file-upload-for-in-me mory-contents/
    but it doesn't seems to be working for me.
                        public function createNewApp(cb:Function , appFile : File):void
                                  var service:HTTPService = new HTTPService();
                                  service.url = ROOT+"apps";
                                  service.showBusyCursor = true;
                                  service.addEventListener(ResultEvent.RESULT, function(e:ResultEvent):void {
                                            //translate JSON
                                            trace(e.result);
                                            var result:String = e.result.toString();
                                            var data:Object = JSON.parse(result);
                                            cb(data.link);
                                  service.addEventListener(FaultEvent.FAULT, defaultFaultHandler); //todo : allow user to add his own as well
                                  authAndUploadNewApp(service,appFile);
                        private function authAndUploadNewApp(service:HTTPService,appFile : File):void {
                                  var encoder:Base64Encoder = new Base64Encoder();
                                  encoder.encode(username + ":"+password);
                                  service.headers = {Accept:"application/json", Authorization:"Basic " + encoder.toString()};
                                  service.method ="POST";
                                  var boundary:String = UIDUtil.createUID();
                                  service.contentType = "multipart/form-data; boundary=—————————" + boundary;
                                  var stream:FileStream = new FileStream();
                                  stream.open(appFile, FileMode.READ);
                                  var binaryData:ByteArray = new ByteArray();
                                  var fileData : String = new String();
                                  stream.readBytes(binaryData);
                                  stream.close();
                                  fileData = binaryData.readUTFBytes(binaryData.bytesAvailable); // I think this is where I have problem.... how do
                           //how do i converrt this bytearray/stream of data to string and send it in my post request's body - i guess if this step work rest should work..  
                                  var params: String = new String();
                                  var content:String = "—————————" + boundary + "nr";
                                  content += 'Content-Disposition: form-data; name="data";' + '{"title":"ELS test app 2","package":"com.elsapp.captivate","version":"12.3.09","create_method":"file"}' + "nr";
                                  content += "—————————" + boundary + "nr";
                                  content += 'Content-Disposition: form-data; name="file";' + fileData  + "nr";
                                  content += "—————————–" + boundary + "–nr";
                                  service.request = content;
                                  service.send();

    In the past I have used URLVariables with URLRequest and URLLoader to achieve this kind of requirement.
    Check out http://livedocs.adobe.com/flex/3/html/help.html?content=17_Networking_and_communications_3 .html which should be useful. My preference has always been to use this style instead of HTTPService objects, giving you a little more control which is what you need here.
    Let me know if you need any more assistance.

  • How can I change the order of html form data submitted to me via email?

    I am having customers contact me via an html form posted on my website using the "sendtoemail" command. When I receive the data in an e-mail it  is not presented in the order it appears on the web page and I can't seem to find out what dictates the order the data is presented in or how I can change it.
    Anyone have any ideas on how I can make HTML form data elements appear in the order I want?
    Thanks,
    Andy

    Or find a commercial form-to-email script that is compatible with your server's configuration (PHP, ASP, Perl...) and customize it to your needs.
    Formm@ailer PHP from DB Masters
    http://dbmasters.net/index.php?id=4
    FormToEmail.com (free & pro versions available)
    http://formtoemail.com/formtoemail_pro_version.php    
    Tectite
    http://www.tectite.com/formmailpage.php
    Forms to Go from Bebosoft (script generating software)
    http://www.bebosoft.com/products/formstogo/overview/
    Nancy O.

  • Submit PDF form data IMS database.

    Hello
    I have developed a pdf form using livecycle designer and it has a submit button in it. The form is published to our organization website. What we would like to do is, when the user opens and fills up the pdf form either on web browser / or after downloading to their desktop, users should be able to post the data in the form directly into our IMS database. Our users are not connected to our organization network but just to the internet.
    I understand that we need to use a Submit button with 'Submit As' property set to XML. IMS connect is an IBM interface that would read this xml and pass the data to the database. But, what I would like to know is the architecture and how the components communicate here. i.e. for our design document.
    I am assuming that we would need to lay out these components on the diagram but not very sure of the order in which the data is flowing from client to the database.
    1. Web browser
    2. Internet Connection
    3. Webserver (this is where the org. website is and the form is located on the website)
    4. LiveCycle ES sitting on an application server?
    5. Database tier.
    Appreciate if anyone could tell me exactly the steps and the data flow.

    You cannot use a submit button to invoke a web service. You woudl create your web service to recieve a single parameter (the XML that represents the data on your form). Then create a hidden field (to hold the data) and bind the input parameter to that field. Now using a regular button, add code that will take the data that is in the data dom and dump it into your hidden field:
    HiddenFieldName.rawValue = xfa.datasets.data.saveXML("pretty")
    Make sure the your hidden field is set for multiline. Now in the next line of code we need to invoke the web service. You can use the invokeBtn supplied by the DataConenction wizard (dropped on your form of course). You can use the command:
    invokeBtn.execEvent("click");
    This will send the data in the hidden field to the web service. You can code your web service to return a string that indicates that the data was recieved. You can bind that output parameter to another hidden field. Once the web service executes then that field will hold the message string. Now you can put up a message box to the user:
    app.alert(hiddenfieldname.rawValue);
    When I talk about hidden fields I mean to make the presence invisible not hidden.
    Make sense?

  • PDFMaker 9.1, Excel 2003, Users can't save form data

    Hi Everyone,
    I'm looking for some assistance with a problem.
    I created a new form in Adobe Pro 9.1 bringing in an excel template.  The final product looked great.  I had our IT department post it on our Intranet, and some individuals commented back they cannot save a copy of the data they entered in the blank form.  I tested with others where it works fine.  I can't confirm 100%, but it seems whoever has the Adobe "Pro" version can save and those with just the "standard" cannot save.  They get that message Save a Blank Copy of this Form, Data typed into this form will not be saved..."etc.
    I tried going to Advanced-Extend Features in Adobe Reader, but that doesn't help either once posted on the website.
    Any suggestions how to enable so that all users (1000's) can save their work they typed into the document if they wish?
    Thanks so much in advance!

    Not specifically addresses whatever is causing the issue.
    Just an obtw re: "extended" PDF forms (which, if there are users of Adobe Reader, will have to be made use of):
    When you "extend" a PDF form usage most comply with the "500 limit" of the EULA.
    With "1000's" of end-users you may well be in harms way.
    See Section 15.12.3 (PDF page 408 of 410).
    http://www.adobe.com/products/eulas/pdfs/Gen_WWCombined-20080205_1329.pdf
    LiveCycle ES avoids this but is costly.
    Alternatively, piping out the user's form input to FDF and processing that at the server level could be done.
    For this, you might have your IT folks give the FDF SDK a look over.
    Be well...

  • Form data - to command - for verification - exec

    I'm attempting to assign entered form data into an array, to generate a list
    of command line commands from the form data, and pass the array to a
    verification page for display. After the displayed and verified information has
    been approved , press a submit button to spawn xterms that get passed the
    information in the array, the command list, for execution. I'm having a
    problems capturing and relaying the data between pages. Currently, the
    information(the command list being generated in variable ${myMap}) is
    being displayed correctly in the VerificationPage.jsp output but not displayed
    correctly (nothing from the ${myMap} variable is displayed)when
    ProcessingPage.jsp is loaded. I would appreciate any help offered. Below is
    the code I'm using.
    File one:
    data/form input
    File two: VerifcationPage.jsp - assign the consolidated command into myMap array and display it to screen
    <c:set scope="application" var="counter" value="0"/>
    <c:forEach var="rel" items="${paramValues.rel}" begin="0" step="1">
         ${myMap} bldautox ${param.phasecmd} -s ${param.submitter} -o r${paramValues.rel[counter]}${param.oldtreeext}${param.oldtreespin} -n r${paramValues.rel[counter]}${param.newtreeext}${param.newtreespin}
         <br>
         <c:set var="counter" value="${counter + 1}"/>
    </c:forEach>
         <br>
    <c:forEach items="${paramValues.myMap}" begin="0" step="1">
         <c:out value="${myMap[count]}" />
    </c:forEach>
         <input type="submit" name="submitbldreqs" value="Submit">
        </form>
    File three-the ProcessingPage.jsp - display each indice of myMap variable and be able to submit for command line execution
    <c:forEach var="myMap" items="${paramValues.myMap}" begin="0" step="1">
         <c:out value="${param.myMap[cntr]}" />
         <c:set var="cntr" value="${cntr + 1}"/>
    </c:forEach>
         <br>
         <% String cmd = "0"; %>
    <%-- Desired executable Runtime.getRuntime().exec("/usr/bin/xterm -e" + {myMap}[cntr]); --%>
         <% Runtime.getRuntime().exec("/usr/bin/xterm"); %>
      </body>

    You put newlines in by pressing the enter key a couple of times.
    see?
    For the rest of it, there is a big handy button with "code" labelled on it.
    [code[/i]]
    // put your code between tags like these.
    [code[/i]]
    That post is a completely unreadable mess. I suggest you try again.

  • How can i submit form-data with acrobat pocket pc

    how can i submit form-data (http-post) on a PPC?
    how can i store the data offline?
    which submit-functions are availabe for the pocket pc reader?
    do i need ARES?
    where can i find a documentation of of the available functions for the ppc version?
    where can i fond form-samples for ppc?
    from the docu on my pocket pc:
    Submit form data using handheld devices over a wireless connection. If you are working offline, the data is temporarily stored, then submitted once a connection is established. Send forms by e-mail or directly to the destination server using a cradle or cable

    To your question regarding the Pocket PC version of Reader, I downloaded Adobe Reader for Pocket Pc 2 and installed it on my HP iPAQ . I then loaded my test PDF file onto the iPAQ. The Reader for Pocket PC preformed an email submission fine. However, I received no indication that anything happened when I tried an HTTP Post. So I think you can only do an email submission.
    In general, I have been testing to see how much I can do without the Live Cycle Reader Extensions, since for sure I will never be able to purchase them. What I have found is that for Acrobat Reader 7, the email submission works for all of the people I have asked to test it, but the HTTP Post has worked for only one of the two people who have tested it so far with Reader 7 (the one for which it worked claims that he only has Reader 7 on his computernot Acrobat).

Maybe you are looking for