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

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









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 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..   Visit Here
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
Using a image for Browse button instead of normal html Browse button for Uploading files from a JSP - JSP-Servlet
Using a image for Browse button instead of normal html Browse button for Uploading files from a JSP  I am using the following code snippet.... Is it not possible to use a image instead of normal html Browse button for uploading files
File uploading - JSP-Servlet
File uploading  i am using file uploading code for multiple file and aslo for single file but i am getting problem that No such file found.... http://www.roseindia.net/jsp/file_upload/Sinle_upload.xhtml.shtml
Uploading a file using UploadBean
Uploading a file using UploadBean  Dear sir, In my project i have to upload the file and use the same file for getting a values from that uploaded .xls file.I used UploadBean for uploading .For the first time when i
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
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 an image - JSP-Servlet
Uploading an image  I am doing a jsp project. In this uploading an image is a part. For that i had done a coding for uploading... and uploading is done by different jsp coding. I don't know how to code for file size
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 tha file - JSP-Servlet
Uploading tha file  hi,Sir. this is siddaiah. please give me response for the follwing questions. 1.how to upload file into oracle database using JSP? 2.How to upload photo into oracle database using JSP? Regards
java/jsp code to download a video
java/jsp code to download a video  how can i download a video using jsp/servlet
file uploading - JSP-Servlet
jsp
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
video streaming - JSP-Servlet
video streaming  how to do video streaming in JSP ? the project is all about the VIRTUAL CLASS ROOM. i hv to show a video of the live class to my client computers.So i need video streming code for that. plz help me
FILE UPLOADING - JSP-Servlet
FILE UPLOADING  Hi , I want Simple program for file upload using html and servlet plese help me  hi friend pls try this code ********** try{ String type=""; String boundary=""; String sz
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
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
jsp with excel sheet data uploading into database
jsp with excel sheet data uploading into database  how to upload data in excel sheet with jsp into oracle 10g database
Multiple file Uploading - JSP-Servlet
Multiple file Uploading   Hello everyone I am using jsp and my IDE... files using the same code provided on the site and i am getting hell lot of errors... that is raised: 16:37:14,612 ERROR [[jsp]] Servlet.service
Uploading multiple files in JSP - JSP-Servlet
Uploading multiple files in JSP  Hi, I have this code in JSP for Uploading multiple files : Samples : Simple Upload.../jsp/file_upload/uploadingMultipleFiles.shtml Hope that it will be helpful
Record and Save Video using Java
Record and Save Video using Java  How to record video(webcam) and save it using Java.?? Its really urgent
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
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.
Uploading Excel sheet record in JSP to insert data in MySql
Uploading Excel sheet record in JSP to insert data in MySql  Need Help how to upload Excel (.xls) file and insert data in Mysql using JSP it wil be wonder for me if any help me
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
image uploading perminssion in server - JSP-Servlet
image uploading perminssion in server  Thanks deepak following my...("file.separator"); int last=path.lastIndexOf(seperator+"jsp"); String... other uploading script please help me.. thanks   Hi, Plz give
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
image uploading perminssion in server - JSP-Servlet
image uploading perminssion in server  dear friend... following is my uploading code and i want to save some records.... exception org.apache.jasper.JasperException: Exception in JSP: /jsp
java code for uploading a resume in a form - JSP-Servlet
java code for uploading a resume in a form  can anyone help me with the codes 4 uploading a resume in a registration form  Refer this link http://www.devsphere.com/mapping/docs/guide/upload.html Thanks Rajanikant
Need help in image uploading - JSP-Servlet
Need help in image uploading  hii, i have one doubt in uploading an image in jsp. I want to display image from DB to my jsp page. For that i... a folder named images in server but cant upload.Is any extra code need for uploading
image uploading perminssion in server - JSP-Servlet
image uploading perminssion in server  thanks dear, but i am working in Linux Ubuntu, how can i set the path in server. my problem is i am not able to access the folders wherever we are uploading the files, we are not able
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
how to record qvga video using j2me - Applet
how to record qvga video using j2me  hello if it is possible how i can record qvga video usin j2me
urgent need for jsp code with mysql query for uploading and downloading file - JSP-Servlet
urgent need for jsp code with mysql query for uploading and downloading file  can anyone tell me how to upload and download a doc file using jsp with mysql as the back end... and kindly help me to create the table too
edit the flash video file using html5
edit the flash video file using html5  hi iam vivek i have a flash file i want to edit it with html5 please reply
how to record qvga video using j2me - Applet
how to record qvga video using j2me  hello if it is possible how i can record qvga video usin j2me?   Hi Friend, Please visit the following links: http://www.roseindia.net/j2me/video-midlet.shtml http
Is JSF using JSP?
Is JSF using JSP?  Is JSF using JSP
tree using jsp code
tree using jsp code  i want to draw a tree structure of a family hierarchy using jsp code
report generation using jsp
report generation using jsp  report generation coding using jsp
Pass hidden veritable while uploading file - JSP-Servlet
Pass hidden veritable while uploading file  Hi All, Is there any... are uploading file, all the parameter other then file upload are null. Is it write? Please guide me in this issue. Again, in simple word my Q is "How to pass hidden
A Java Program by using JSP
A Java Program by using JSP  how to draw lines by using JSP plz show me the solution by using program
Uploading Single File by Using JSP

Ads