Return-Path: Delivered-To: apmail-jakarta-tomcat-user-archive@www.apache.org Received: (qmail 84567 invoked from network); 10 Aug 2004 14:00:43 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur-2.apache.org with SMTP; 10 Aug 2004 14:00:43 -0000 Received: (qmail 92759 invoked by uid 500); 10 Aug 2004 14:00:06 -0000 Delivered-To: apmail-jakarta-tomcat-user-archive@jakarta.apache.org Received: (qmail 92659 invoked by uid 500); 10 Aug 2004 14:00:06 -0000 Mailing-List: contact tomcat-user-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Tomcat Users List" Reply-To: "Tomcat Users List" Delivered-To: mailing list tomcat-user@jakarta.apache.org Received: (qmail 92639 invoked by uid 99); 10 Aug 2004 14:00:05 -0000 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received: from [63.244.250.133] (HELO warhawk.mpi.com) (63.244.250.133) by apache.org (qpsmtpd/0.27.1) with ESMTP; Tue, 10 Aug 2004 07:00:01 -0700 Received: from thunderbolt.mpi.com (thunderbolt [63.244.253.70]) by warhawk.mpi.com (Switch-3.1.6/Switch-3.1.6) with ESMTP id i7ADxwgN010269 for ; Tue, 10 Aug 2004 09:59:58 -0400 (EDT) Received: from US-VS1.corp.mpi.com (us-be2.corp.mpi.com [63.244.252.32]) by thunderbolt.mpi.com (Switch-3.1.4/Switch-3.1.0) with ESMTP id i7ADxmUE015667 for ; Tue, 10 Aug 2004 09:59:48 -0400 (EDT) X-MimeOLE: Produced By Microsoft Exchange V6.0.6487.1 content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Subject: RE: How to Upload a File Using JSP?.(Snippest of code needed) Date: Tue, 10 Aug 2004 09:59:56 -0400 Message-ID: <9C5166762F311146951505C6790A9CF80229BE5C@US-VS1.corp.mpi.com> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: How to Upload a File Using JSP?.(Snippest of code needed) Thread-Index: AcR+4gcRRPFPtGhKTcC2E4fSwqNREwAAAhzw From: "Shapira, Yoav" To: "Tomcat Users List" X-Virus-Checked: Checked X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N H= ola, Cos.jar works but it's not as actively developed as fileupload and I don't like it as much anyways. If http://jakarta.apache.org/commons/fileupload/using.html and http://www.cs.tut.fi/~jkorpela/forms/file.html together aren't enough help for you, then I don't know what else to suggest ;) Yoav Shapira Millennium Research Informatics >-----Original Message----- >From: Maruthi [mailto:maruthibabu_2k@yahoo.com] >Sent: Tuesday, August 10, 2004 9:57 AM >To: Tomcat Users List >Subject: RE: How to Upload a File Using JSP?.(Snippest of code needed= ) > >Hello, >Thanks for your reply.I could download the cos.jar from the given >webiste.Then later onwards i am not able to proceed....i mean how to >provide the functionality of uploading into my JSP.My JSP contains tw= o >textboxes and now i have to include the functionality of uploading.Please >help me how to proceed. > >Thanks for your time and patience, >Maruthi. > > > >=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D >My JSP Code:: >=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D > ><%@ page language=3D"java" contentType=3D"text/html" %> ><%@ page import =3D "java.io.*" %> ><%@ page import =3D "java.lang.*" %> ><%@ page import =3D "java.sql.*" %> ><%@ page import =3D "org.apache.turbine.util.RunData" %> ><%@ page import =3D "org.apache.turbine.util.Log" %> ><%@ page import =3D "javax.servlet.http.*" %> ><%@ taglib uri=3D'/WEB-INF/templates/jsp/tld/template.tld' prefix=3D'jetspeed' >%> ><%@ page import=3D"org.apache.commons.fileupload.*" %> > > > <% > try > { > > if(request.getMethod().equals("POST")) > { > > RunData rundata=3D(RunData)request.getAttribute("rundata"); > String jspeid =3D (String) request.getAttribute("js_peid"); > > String cpu1=3D request.getParameter("cpu"); > String architecture1=3D request.getParameter("architecture"); > > Class.forName("org.gjt.mm.mysql.Driver"); > Connection >con=3DDriverManager.getConnection("Jdbc:mysql://localhost:3306/Thesis= work ","r >oot",""); > Statement st=3Dcon.createStatement(); > > String str=3D"INSERT into submitjobs >VALUES('"+cpu1+"','"+architecture1+"','"+file1+"')"; > int i=3Dst.executeUpdate(str); > System.out.println("Number of Rows inserted into >AddGridNodes Table is: " +i+"
"); > > > out.println( "Confirmation-Added Gr= id >Nodes" ); > out.println( "
"); > out.println( "

color=3Dwhite size=3D4>ADD JOBS

"); > out.println(""); > > out.println( "
"); > out.println("
"); > > out.println("
The Details Belongs to >Job: "+cpu1+"  is added to the >Database..!.
"); > out.println("
"); > out.println(""); > out.println(""); > > st.close(); > con.close(); > > > }else > { > %> > >
method=3D"POST">

> >
>

size=3D4>SUBMIT JOBS

>
>
> > > > > > > > > > > > > > > > > > > > > > > >
size=3D2>CPU:*  
size=3D2>Architecture:*  size=3D"20">
size=3D2>Execute PBS File:*   >
>

> > > > >
>
>
> > > ><% > } //else > }catch (Exception e) > { > Log.error(e); > return; > } >%> > >Rowland Watkins wrote: >Maruthi, > >I found the commons fileupload to be a bit heavy. You could try the >O'Reilly Upload Servlet: > >http://www.servlets.com/resources/com.oreilly.servlet/ > >This has a simpler API. Just specify the directory for the file being= >uploaded and it does the rest. If you require multiple files to be >uploaded it may be more suitable to use Struts. > >Cheers, > >Rowland > > >---------------------------------------------------------------------= >To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org >For additional commands, e-mail: tomcat-user-help@jakarta.apache.org > > > >--------------------------------- >Do you Yahoo!? >Yahoo! Mail is new and improved - Check it out! This e-mail, including any attachments, is a confidential business com= munication, and may contain information that is confidential, propriet= ary and/or privileged. This e-mail is intended only for the individua= l(s) to whom it is addressed, and may not be saved, copied, printed, d= isclosed or used by anyone else. If you are not the(an) intended reci= pient, please immediately delete this e-mail from your computer system= and notify the sender. Thank you. --------------------------------------------------------------------- To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org For additional commands, e-mail: tomcat-user-help@jakarta.apache.org