video uploading using jsp
this is the code i hv written for uploading..but the value in dropdown list is not captured..can any 1 tell the reason
html file
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
</head>
<body>
<form action="facultyvideoupload.jsp" enctype="multipart/form-data" method="POST">
<input type="file" name="file2"><br><br>
<select name="select" id="select">
<option value="c">C</option>
<option value="c++">C++</option>
<option value="java">Java</option>
<option value="os">os</option>
<option value="cad/cam">Cad/Cam</option>
<option value="vlsi">Vlsi</option>
</select>
<input type="Submit" value="Upload File"><br>
</form></center>
</body>
</html>
facultyvideouload.jsp
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<%@ page import="java.sql.*" %>
<%@page import="java.sql.Statement"%>
<%@page import="java.sql.PreparedStatement"%>
<%@page import="org.apache.commons.fileupload.DiskFileUpload"%>
<%@page import="java.util.List"%>
<%@page import="org.apache.commons.fileupload.FileItem"%>
<%@page import="java.io.File"%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>uploading page</title>
</head>
<body>
<%!
private String uname;
private String password;
private String email;
private String video;
FileItem fitem3;
PreparedStatement pst;
String query;
%>
<%
try{
Class.forName("oracle.jdbc.driver.OracleDriver");
Connection con=DriverManager.getConnection("jdbc:oracle:thin:@localhost:1521:xe","system","system");
//response.setContentType("multipart/form-data");
DiskFileUpload dfupload = new DiskFileUpload();
List listItems = dfupload.parseRequest(request);
System.out.println("xcxxxxxxxxxxxxxxxxx"+listItems.size());
email = (String)session.getAttribute("user");
System.out.println("email :"+email);
password = (String)session.getAttribute("password");
System.out.println("password :"+password);
String select=request.getParameter("select");
System.out.println("select :"+select);
fitem3 = (FileItem)listItems.get(0);
String abname = fitem3.getName();
System.out.println(abname);
int index = abname.lastIndexOf(File.separator);
video = abname.substring(index+1);
query = "insert into video(emailid,password,video,subject) values(?,?,?,?)";
pst = con.prepareStatement(query);
pst.setString(1,email);
pst.setString(2,password);
pst.setString(3,video);
pst.setString(4,select);
int i = pst.executeUpdate();
if(i>0){
String savepath = getServletContext().getRealPath("/");
StringBuilder sb = new StringBuilder(savepath);
for(int c=0; i<sb.length(); i++){
if(sb.charAt(c)==File.separatorChar)
sb.insert(c++,'\\');
}
File outfile = new File(sb+"videos\\"+video);
System.out.println("pathhhhhhhhhhhhhh: "+outfile);
fitem3.write(outfile);
response.sendRedirect("home2.html");
}
else{
//request.getRequestDispatcher("home2.html").forward(request,response);
}
pst.close();
}
catch(Exception e)
{
out.println("Error:"+e);
}
%>
</body>
</html>
View Answers
Ads
Related Tutorials/Questions & Answers:
video uploading using jsp
video uploading using jsp how to upload a videos in web page
using jsp
Hi,
You can upload your
video with the help of
JSP file upload code. Once file is upload you can play
using any
video player.
Get the code
video uploading using jsp
video uploading using jsp this is the code i hv written for
uploading..but the value in dropdown list is not captured..can any 1 tell the reason...; charset=ISO-8859-1">
<title>
uploading page</title>
</head>
Advertisements
Uploading image using jsp
Uploading image
using jsp how to upload image
using jsp. Already i... that image file ...
I want know that solution
using by u...
Thanks,
P.S.N.
Here is a
jsp code that upload image and display it on the browser.
1
file uploading using jsp
file
uploading using jsp below file
uploading code has one error "toBytes[i-start]=fromBytes; " incompatable type error please help me how to solve... in
uploading ");
}
%>
Hi Friend,
Try the following code:
1
Uploading a single file by using JSp
Uploading a single file by
using JSp u have said about submit button..but in program u have not used submit button..and where file will be stored..where should we specify the output folder name..
Visit Here
Uploading Multiple Files Using Jsp
Uploading Multiple Files
Using Jsp
 ... to understand how you can upload multiple files by
using the
Jsp.
We should avoid... by
using Jsp and how they will get stored on the particular memory area. To get
Uploading a single file by using JSp
Uploading a single file by
using JSp u have said about submit button..but in program u have not used submit button..and where file will be stored..where should we specify the output folder name..
1)page.jsp:
<
uploading a file at another system in lan using jsp
uploading a file at another system in lan
using jsp Thanks for the code at "http://www.roseindia.net/
jsp/fileupload/Sinleupload.xhtml.shtml". It is working when i gave address of the local system to savefile But if i want
how to play video in website using jsp
how to play
video in website
using jsp please help me friend how to play a
video in webiste by
using jsp which playres are used and how to play
video please give me code
Uploading Single File by Using JSP
Uploading Single File by
Using JSP
 ... to understand how you can upload a file by
using the
Jsp.
As
Jsp is mainly used... by
using
Jsp and how it will get stored on a particular memory area. To get
Uploading Single File by Using JSP
Uploading Single File by
Using JSP
 ... to understand how you can upload a file by
using the
Jsp.
As
Jsp is mainly used... by
using
Jsp and how it will get stored on a particular memory area. To get
Uploading Multiple Files Using Jsp
Uploading Multiple Files
Using Jsp
 ... to understand how you can upload multiple files by
using the
Jsp.
We should avoid... by
using Jsp and how they will get stored on the particular memory area. To get
excel uploading in jsp
excel
uploading in jsp could you provide the source code for:
1)have to upload an empty excel sheet at client side i.e if client clicks an excel... given and printing them in a
jsp page.
could you please provide the code in spring
Uploading a software and displaying it on the jsp page
Uploading a software and displaying it on the
jsp page I have a Downloads page in my website, I want it to display the name of softwares as soon as it is uploaded in the backend by the administrator. And the admin may be a non
upload video using php
upload
video using php How to upload a
video on MYSQL Server
using PHP Code..? Can any one provide me an example
Uploading an image into the table - JSP-Servlet
Uploading an image into the table how to upload an image... a connection by
using Connection interface
Connection connection = null;
/* Create...();
/* Create a connection by
using getConnection() method that takes
Video streaming using java
Video streaming
using java I want to create a website based on
video... have to stream the
video in the server side and send that to the client side.(Like youtube i.e no
video url has to be used in client side).
I didn't have any
uploading a file - JSP-Interview Questions
uploading a file
uploading a file and storing in database
using clog and blog?
java code in swing for that i want Hi Friend,
Try the following code:
import java.io.*;
import java.sql.*;
import java.util.
image uploading perminssion in server - JSP-Servlet
image
uploading perminssion in server Dear All,
I am facing some problem image
uploading in server that i working fine in my system, OS Ubuntu...)
com.oreilly.servlet.MultipartRequest.(MultipartRequest.java:89)
org.apache.jsp.jsp.BSAdminProductsCreate_
jsp
JSP Project: implementing video chatting in JSP
JSP Project: implementing
video chatting in JSP Hi!!! I am developing a chatting application in
JSP and Servlet. I want to implement
video chatting facility on my website. How can I do this task. Please help at the earliest
Thumbnail creator for uploaded video files in jsp
Thumbnail creator for uploaded
video files in jsp i am working in
jsp..i need a thumbnail creator for the
video that will be uploaded by the user of my website(like youtube)...Once the
video has been uploaded,i wanna display
tree using jsp code
tree
using jsp code i want to draw a tree structure of a family hierarchy
using jsp code
ScatterPlot using jsp
ScatterPlot
using jsp hi,
can anybody provide me code for ScatterPlot
using jsp.
thanks