tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Maruthi <maruthibabu...@yahoo.com>
Subject RE: How to Upload a File Using JSP?.(Snippest of code needed)
Date Tue, 10 Aug 2004 13:06:58 GMT
Hello Yoav,
Thanks for your reply.I already gone throuth the link.But i am getting some problems as there
is no clear example how to proceed.
 
A  clear example to upload a file from HTML form would be helpful.
 
Thanks for your time,
Maruthi.

"Shapira, Yoav" <Yoav.Shapira@mpi.com> wrote:
Hi,
Check out the Jakarta Commons Fileupload examples at
http://jakarta.apache.org/commons/fileupload/.

Yoav Shapira
Millennium Research Informatics


>-----Original Message-----
>From: Maruthi [mailto:maruthibabu_2k@yahoo.com]
>Sent: Tuesday, August 10, 2004 5:05 AM
>To: tomcat-user@jakarta.apache.org
>Subject: How to Upload a File Using JSP?.(Snippest of code needed)
>
>Hello Everybody,
>I got some problem regarding file uploading using JSP.
>
>In my JSP I have a form which contains 2 textboxes and other text box
for
>uploading a file.I need to store the information of 2 text
boxes,uploaded
>file in the mysql databse.I am looking for the code for uploading a
file
>using JSP.
>
>Please see below for my code.In this code i need to include the code
for
>uploading a file.
>
>Any help in this regard would be greatly appreciated..Pl reply in this
>regard.
>Thank you,
>Maruthi.
>
>=============================
>
>
>
>
>
>
>
>
>
>prefix='jetspeed'
>%>
>>
>
>  >  try
>  {
>
>   if(request.getMethod().equals("POST"))
>   {
>        String cpu1=    request.getParameter("cpu");
>      String architecture1=  request.getParameter("architecture");
>
>
>          Class.forName("org.gjt.mm.mysql.Driver");
>       Connection
>con=DriverManager.getConnection("Jdbc:mysql://localhost:3306/Thesiswork
","r
>oot","");
>       Statement st=con.createStatement();
>
>          String str="INSERT into submitjobs
>VALUES('"+cpu1+"','"+architecture1+"','"+file1+"')";
>            int i=st.executeUpdate(str);
>               System.out.println("Number of Rows inserted into
>AddGridNodes Table  is: " +i+"
");
>
>
>               out.println( "Confirmation-Added Grid
>Nodes" );
>             out.println( "
");
>             out.println( "face=Verdana,Geneva,Arial
>color=white size=4>ADD JOBS");
>             out.println("");
>
>             out.println( "
");
>             out.println("The Details Belongs to
>Job: "+cpu1+"  is added to the
>Database..!.
");
>
>             out.println("");
>             out.println("");
>             out.println("");
>             out.println("");
>
>       st.close();
>       con.close();
>
>
>      }else
>      {
>  %>
> 
> >method="POST">


> 
> 

> >size=4>SUBMIT JOBS
> 

> 
>
> 
> 
> >size=2>CPU:*
>   
>  [input] 
> 
>
> 
> >size=2>Architecture:*
>   
>  [input] >size="20">
> 
>
> 
> >size=2>Execute PBS File:*
>   
>  [input] 
> 
>
>
>
>
>
> 
> 


>
>  [input] 
>
>
> 
> 
> 
> 
>
>
>>   } //else
>   }catch (Exception e)
>   {
>      Log.error(e);
>     return;
>  }
>%>
>
>
>
>
>---------------------------------
>Do you Yahoo!?
>New and Improved Yahoo! Mail - Send 10MB messages!

---------------------------------------------------------------------
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 - 50x more storage than other providers!
Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message