Using java to submit a file in on a webpage form

Hi all
Does anyone know how to submit a file to a form with a <input 'file'> field?
What I'm really looking for here is what the format of the reply should be. Normally, form data is like
?forumID=31&name=tjacobs01
but file data needs to include at least 2 things: The name of the file and the data itself. How is this done? Anyone know?
BTW, if anyone knows of an apache or other open source solution to this, that would be fabulous!
Thanks!
-T

I tried wireshark but couldn't figure it out.
After lunch, I came back, took down my firewall, started up tomcat and tried hitting myself with the file upload request... I think I've got everything I need now. Thanks for the help paul.
BTW, there's this separator thing that separates sections of the multi-part content. It looks like
---------------------------7d73991030670
The dashes all stay the same but the numbers and letters change... Does anyone know how this is generated? To me, it looks like it might be a hex representation of the time. Does anyone know for sure?
- Just tried it. it's definitely not the hex for System.currentTimeMillis
Edited by: tjacobs01 on Dec 11, 2007 11:18 AM

Similar Messages

  • How to generate reportdesign dynamically using java with out xml file

    hi
    how can i generate a reportdesign dynamically using java with out passing xml file to jasperDesign , i want to create my reportdesign with out xml file
    how can i ,please help
    thanks

    LiveCycle does provide a Java API to forms; LiveCycle is in fact a suite of programs, mostly enterprise level for running on server (next to which the cost of the master suite is a drop in the ocean). LiveCycle Designer is perhaps the only end user tool, and it is not for server use and doesn't have an API.
    Are you looking for a server solution? If so, nothing in the master suite can help, it isn't for server use.

  • Quiz using Java Script and XML file

    Hi,
    I am student from Liverpool in the UK. I am currently making a "quiz" website that links to an xml document, and brings back results of how the user has done.
    I have made the website, and linked it to the xml document, but I can't get javascript to tell the user how many answers they got correct. Can you help me?
    A friend told me to use a function, and then link that function to a box that, when clicked, brings up an alert box telling the user how many they got correct.
    I know this is probably very simple, but I would be very grateful for help in which exact commands to write that will bring up an alert box when the user clicks on a "Submit" button. This alert box should bring up how many correct answers (out of 10) the user obtained.
    Thanks for your time,
    Matthew Tickle.

    Java and Javascript are completely different. You probobally wont get much here... maybe u should try to find a javascript forum or look at some tutorials: http://tutorials.findtutorials.com/index/category/20

  • Anybody know how to use jave work with mapping file? help!

    mapping file are somehow those...
    <db-insert root-element>
    .....<map-info>
    something like that, and I dont know how java code can use with them..my database is mysql...
    or any reference site is good.?
    Thank you very much

    urm...thanks..
    my job is about to write a transformation tool to transform XML documents into a database. The tools is written for users to extract data in XML format and store it into a database. But i would choose MYSQL. Mapping files are used to store information correctly into database to avoid the need to write new code for each type of XML files. And can choose any programing langugage for implementation such as Java and C#.........and currently still looking on Java or VB

  • Using java to create a file?

    hi there
    I just have a question regarding the creation of a file using PrintWriter class.:
    FileOutputStream fileOutputStream = new FileOutputStream(outFileName);
    PrintWriter out = new PrintWriter(new OutputStreamWriter(fileOutputStream, encoding));
    after the file is being created, do I need to set out to null. because I was not able to move or modifiy the file while the program is running.
    thank you for your help.

    to null. because I was not able to move or modifiy the
    file while the program is running.
    thank you for your help.that is because the program locks the file.

  • How do I use Adobe to Edit PDF files, I have an application form I need to Edit?

    I have an application form that is in PDF format, I wish to edit this form by adding text to specific fields, how do I go about doing this?

    If the file has fields - actual PDF fields, you just type. The text goes in the fields.
    Or do you want to turn it into a fillable form?
    Or do you want to fill in, a non fillable form, just once?
    By the way if you have an application form and it isn't fillable, they DON'T expect you to fill it. Just print it and treat it like it came in the mail.

  • How to check & unzip zip file using java

    Dear friends
    How to check & unzip zip file using java, I have some files which are pkzip or some other zip I want to find out the type of ZIp & then I want to unzip these files, pls guide me
    thanks

    How to check & unzip zip file using java, I have
    ve some files which are pkzip or some other zip I
    want to find out the type of ZIp & then I want to
    unzip these files, pls guide meWhat do you mean "other zip"? Either they're zip archives or not, there are no different types.

  • How to extract .sit files(in MAC)  using java program

    Hi,
    please help me , i want to simple program for
    " how to extract .sit files(in MAC) using java program"
    that sit files same as zip files in windows..[                                                                                                                                                                                                                                                                                                                                   

    Thanks for reply...
    but i search in the google about this topic...there is no results will appear..
    the problem is "i have to run program in the MacOS like extract all the
    .sit(StuffIt) extension files. These sit files same as zip files in the windows... we have one tool called StuffIt Expander but it is 3rd party tool. but here requirement is i have to write my own program to extract all the files same as zip file program...
    please do the needful..i am waiting for ur reply,,,

  • Merge LiveCycle Form with XML using JAVA

    Hello.
    I am trying to find out how to merge non-interactive form with XML (using JAVA) so the users can see the final output form with the data filled in.
    What are my choices..?
    So far, I have created the interactive forms as template using LiveCycle 8 and wrote ASP.NET code to extract data and store it in SQL database when the user fill out and submit the form.
    It works great but another agency wants to access the form as well.
    They told us that they will create the XML themselves from the database, so they just need to combine the form with XML to display it (non-interactive form).
    They want to use JAVA but I am not sure how to do that...
    Any suggestion?

    Assuming that you start with XML in an org.w3c.dom.Document that stores the XML data. Before you can merge it into a form, you have to convert it to a com.adobe.idp.Document object. TO convert a org.w3c.dom.Document to a com.adobe.idp.Document object -- use the following Java code:
    private Document convertDataSource(org.w3c.dom.Document myDOM)
    byte[] mybytes = null;
    try
    //Create a Java Transformer object
    TransformerFactory transFact = TransformerFactory.newInstance();
    Transformer transForm = transFact.newTransformer();
    //Create a Java ByteArrayOutputStream object
    ByteArrayOutputStream myOutStream = new ByteArrayOutputStream();
    //Create a Java Source object
    javax.xml.transform.dom.DOMSource myInput = new DOMSource(myDOM);
    //Create a Java Result object
    javax.xml.transform.stream.StreamResult myOutput = new StreamResult(myOutStream);
    //Populate the Java ByteArrayOutputStream object
    transForm.transform(myInput,myOutput);
    // Get the size of the ByteArrayOutputStream buffer
    int myByteSize = myOutStream.size();
    //Allocate myByteSize to the byte array
    mybytes = new byte[myByteSize];
    //Copy the content to the byte array
    mybytes = myOutStream.toByteArray();
    catch (Exception e) {
    System.out.println("The following exception occurred: "+e.getMessage());
    //Create a com.adobe.idp.Document object and copy the
    //contents of the byte array
    Document myDocument = new Document(mybytes);
    return myDocument;
    THen you can merge myDocument into the Form using renderPDFFOrm:
    FormsResult formOut = formsClient.renderPDFForm(
    formName, //formQuery
    myDocument, //inDataDoc
    pdfFormRenderSpec, //PDFFormRenderSpec
    uriValues, //urlSpec
    fileAttachments //attachments
    Hope this helps!

  • Using java scripts for pdf

    I am trying to find a sort of tutorial on how to use java scripts for pdf files, particularly in setting up repetitive links between several pdf files.

    Here is a very nice website that has tons and tons of stuff for pdf using java script. Enjoy!
    http://www.planetpdf.com/forumarchive/forum34.htm

  • Parameter Passing to Subreport Database Command in CR2008 using java

    Hi
    In subreport i have  a query which accept parameter from the parameter list and works fine in crystal report designer but using java when i am trying to pass the parameter form it gives me error ERROR java.lang.nullpointer Exception. Below is the code attached to send parameter to subreport.
    oReportClientDocument = new ReportClientDocument ();
                oReportClientDocument.open ( strRepPath, 0 );
                reportSource = oReportClientDocument.getReportSource ();
                oCrystalReportViewer = new CrystalReportViewer ();
                oCrystalReportViewer.setOwnPage ( true );
                oCrystalReportViewer.setOwnForm ( true );
                oCrystalReportViewer.setDisplayGroupTree ( false );
                oCrystalReportViewer.setDisplayToolbar ( true );
                oCrystalReportViewer.setPrintMode ( CrPrintMode.PDF );
              if ( fields != null )
                    oFields = new Fields ();
                    if ( !fields.isEmpty () )
                        o = null;
                        i = null;
                        o = new Object ();
                        i = fields.keySet ().iterator ();
                        while ( i.hasNext () )
                            o = i.next ();
                             setParamaterFields ( oFields, o.toString (), fields.get ( o ) );
                    oCrystalReportViewer.setParameterFields ( oFields );

    Hi David,
    I guess you already have the parameters in the Main report.
    Create a formula called Start_Date:
    Min({?Date_Parameter})
    Create another formula called End_date:
    Max({?Date_Parameter})
    Next, insert the sub-report with Order details table as the datasource.
    Then, right-click the subreport and select Change Subreport Links > Move the Start_date formula and End_date to the 'Fields to link to' area and make sure you uncheck the option 'Select data in subreport based on field' for both of them.
    Then, you also wish to link Salesman_Id, so move this field to the 'Fields to link to' area and from the drop-down for 'Select data in subreport based on field' select the Salesman_ID from the sub-report.
    Now, right-click the sub-report and select Edit subreport. The design page of the Subreport opens up. Go to Report > Record Selection formula and it should show {?pmSalesman_ID} = . Edit the selection formula to include the start and end date like this:
    *{?Pm-Salesman_ID} = and (ORDER_DATE >= {?Pm-@Start_date} or ORDER_DATE <= {?Pm-@End_date})*
    Let me know how this goes!
    -Abhilash

  • HTTP POST with Java? (Submit file)

    I want to submit a file to a web service using Java, specifically the JXXX Compiler Service (http://www.innovation.ch/java/java_compile.html). It seems like the page uses HTTP POST. How can I do this?
    Any help would be appreciated.

    I suggest you ask them you question.
    Have you read the instructions on how to use it.
    http://www.innovation.ch/java/java_comp_instr.html

  • I am trying to use java  file as Model layer and jsf as presentation layer

    I am trying to use java file as Model layer and jsf as presentation layer and need some help
    I successfully get the value of h:outputText from java file by doing simple binding operation but I am facing problems when I am trying to fill h:dataTable
    I create java file
    package oracle.model;
    import java.sql.;*
    import java.util.;*
    *public class TableBean {*
    Connection con ;
    Statement ps;
    ResultSet rs;
    private List perInfoAll = new ArrayList();
    *public List getperInfoAll() {*
    perInfoAll.add(0,new perInfo("name","username","blablabla"));
    return perInfoAll;
    *public class perInfo {*
    String uname;
    String firstName;
    String lastName;
    *public perInfo(String firstName,String lastName,String uname) {*
    this.uname = uname;
    this.firstName = firstName;
    this.lastName = lastName;
    *public String getUname() {*
    return uname;
    *public String getFirstName() {*
    return firstName;
    *public String getLastName() {*
    return lastName;
    right click on the file and choose 'create data control'
    then i wrote the jsf file:
    *<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%>*
    *<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>*
    *<f:view>*
    *<h:dataTable id="dt1" value="#{bindings.perInfoAll}"*
    var="item" bgcolor="#F1F1F1" border="10"
    cellpadding="5" cellspacing="3" rows="4" width="50%"
    dir="LTR" frame="hsides" rules="all"
    *>*
    *<f:facet name="header">*
    *<h:outputText value="This is 'dataTable' demo" id="ot6"/>*
    *</f:facet>*
    *<h:column id="c2">*
    *<f:facet name="header">*
    *<h:outputText value="First Name" id="ot1"/>*
    *</f:facet>*
    *<h:outputText style="" value="#{item.firstName}"*
    id="ot2"/>
    *</h:column>*
    *<h:column id="c4">*
    *<f:facet name="header">*
    *<h:outputText value="Last Name" id="ot9"/>*
    *</f:facet>*
    *<h:outputText value="#{item.lastName}" id="ot8"/>*
    *</h:column>*
    *<h:column id="c3">*
    *<f:facet name="header">*
    *<h:outputText value="Username" id="ot7"/>*
    *</f:facet>*
    *<h:outputText value="#{item.uname}" id="ot4"/>*
    *</h:column>*
    *<f:facet name="footer">*
    *<h:outputText value="The End" id="ot3"/>*
    *</f:facet>*
    *</h:dataTable>*
    *</center>*
    *</af:document>*
    *</f:view>*
    but nothing is appear in my table
    I know that there is something wrong in calling the binding object
    I need help pls and where can i find some help to deal with another tag types
    thanks

    i dragged the "perInfoAll" from my "Data Controls" and choosed adf table (even I know that new table with adf tags well be generated and i want table with jsf tags)
    and this code is generated
    *<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"*
    *"http://www.w3.org/TR/html4/loose.dtd">*
    *<%@ page contentType="text/html;charset=UTF-8"%>*
    *<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>*
    *<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%>*
    *<%@ taglib uri="http://xmlns.oracle.com/adf/faces/rich" prefix="af"%>*
    *<f:view>*
    *<af:document id="d1">*
    *<af:messages id="m1"/>*
    *<af:form id="f1">*
    *<af:table value="#{bindings.perInfoAll1.collectionModel}" var="row"*
    *rows="#{bindings.perInfoAll1.rangeSize}"*
    *emptyText="#{bindings.perInfoAll1.viewable ? 'No data to display.' : 'Access Denied.'}"*
    *fetchSize="#{bindings.perInfoAll1.rangeSize}"*
    *rowBandingInterval="0"*
    *selectionListener="#{bindings.perInfoAll1.collectionModel.makeCurrent}"*
    *rowSelection="multiple" id="t1">*
    *<af:column sortProperty="uname" sortable="false"*
    *headerText="#{bindings.perInfoAll1.hints.uname.label}"*
    *id="c1">*
    *<af:inputText value="#{row.bindings.uname.inputValue}"*
    *label="#{bindings.perInfoAll1.hints.uname.label}"*
    *required="#{bindings.perInfoAll1.hints.uname.mandatory}"*
    *columns="#{bindings.perInfoAll1.hints.uname.displayWidth}"*
    *maximumLength="#{bindings.perInfoAll1.hints.uname.precision}"*
    *shortDesc="#{bindings.perInfoAll1.hints.uname.tooltip}"*
    *id="it3">*
    *<f:validator binding="#{row.bindings.uname.validator}"/>*
    *</af:inputText>*
    *</af:column>*
    *<af:column sortProperty="firstName" sortable="false"*
    *headerText="#{bindings.perInfoAll1.hints.firstName.label}"*
    *id="c2">*
    *<af:inputText value="#{row.bindings.firstName.inputValue}"*
    *label="#{bindings.perInfoAll1.hints.firstName.label}"*
    *required="#{bindings.perInfoAll1.hints.firstName.mandatory}"*
    *columns="#{bindings.perInfoAll1.hints.firstName.displayWidth}"*
    *maximumLength="#{bindings.perInfoAll1.hints.firstName.precision}"*
    *shortDesc="#{bindings.perInfoAll1.hints.firstName.tooltip}"*
    *id="it2">*
    *<f:validator binding="#{row.bindings.firstName.validator}"/>*
    *</af:inputText>*
    *</af:column>*
    *<af:column sortProperty="lastName" sortable="false"*
    *headerText="#{bindings.perInfoAll1.hints.lastName.label}"*
    *id="c3">*
    *<af:inputText value="#{row.bindings.lastName.inputValue}"*
    *label="#{bindings.perInfoAll1.hints.lastName.label}"*
    *required="#{bindings.perInfoAll1.hints.lastName.mandatory}"*
    *columns="#{bindings.perInfoAll1.hints.lastName.displayWidth}"*
    *maximumLength="#{bindings.perInfoAll1.hints.lastName.precision}"*
    *shortDesc="#{bindings.perInfoAll1.hints.lastName.tooltip}"*
    *id="it1">*
    *<f:validator binding="#{row.bindings.lastName.validator}"/>*
    *</af:inputText>*
    *</af:column>*
    *</af:table>*
    *</af:form>*
    *</af:document>*
    *</f:view>*
    but when run it i see the following errors
    *Class oracle.adf.model.adapter.bean.BeanDataControl can not access a member of class nl.amis.hrm.EmpManager with modifiers "private"*
    *Object EmpManager of type DataControl is not found.*
    *java.lang.NullPointerException*
    *Class oracle.adf.model.adapter.bean.BeanDataControl can not access a member of class nl.amis.hrm.EmpManager with modifiers "private"*
    *Object EmpManager of type DataControl is not found.*
    *java.lang.NullPointerException*
    :(

  • Using Java, How can I Update, Add, Delete nodes in XML Files.

    Hi,
    I want to store the student record (like Name, Age, school name, total mark etc.,) as nodes in the XMLfile. Also I should able to Update, Add, Delete any nodes (student record) in the XML file. How can I achieve this...using Java
    I am able to read the content of the xml file using xml-parser. But my problem is
    updating the xml file.
    pls suggest some solutions or links with " example source code"
    Thanks :-)

    There are 2 kinds of XML parsers : SAX and DOM. DOM seems to suit your need. You can use JAXP APIs to add, delete or change nodes or attributes.
    http://java.sun.com/webservices/jaxp/dist/1.1/docs/tutorial/TOC.html provides contents that would satisfy most of the needs.
    To save a DOM modified XML file use java IO APIs to write to the same file from which it was read using a Document object ( doc.getNodeValue() ).

  • Help needed  while exporting crystal reports to HTML file format using java

    Help needed  while exporting crystal reports to HTML file format using java api(not using crystalviewer).i want to download the
    html file of the report
    thanks

    the ReportExportFormat class does not have HTML format, it has got to be XML. Export to HTML is available from CR Designer only.
    Edited by: Aasavari Bhave on Jan 24, 2012 11:37 AM

Maybe you are looking for

  • Upload .mov from iphone to mac

    I've had trouble getting .mov files playing on my iMac after syncing from my iPhone 4.  They don't play under VLC, Quicktime, etc. But now I've found that emailing the movie to my account on the iMac works because I can play the .mov attachment. So i

  • I need to create ACL to control access to 17 vlans

    Hi, we have created vlans based on departments, each department has its own vlan. as a result we have close to 17 vlans and this is in one site. we have 5 sites where all these vlans exist but with different subnets. my question has two parts: 1> I n

  • Timestamp (java) - datetime (informix) problem

    hi, when executing a finder method (findByXXX(java.sql.Timestamp arg0)) i get the following error message: -1262 Non-numeric character in datetime or interval. column type of my informix table is datetime ("year to fraction(3)"). surprisingly i can c

  • Direct Procurement  for BOM component

    Hi there,             If we want to use direct  procurement for BOM component then where do we set the indicatior in BOM. I am not able to find the same in BOM.........?? Please advice me .... Regards Kaushik

  • My firefox latest version keeps crashing

    And it won't save the last tabs that were open. This is the mobile Android firefox