How to upload video in java: first define the layout file html, and load the video playback tag in a new window; then get the time and convert it into a string, and use the jsp file to select the video file and submit it to the background; finally process the java file Then go to [upload_video.jsp] through control and demonstrate.
[Related learning recommendations:java basic tutorial]
How to upload videos in java:
1. First, the code of the jsp page here defines the layout file html as shown in the figure
2. This is a js file that opens a new sub-window. And load the video playback tag into the page
3. Upload the file java code to get the time and convert it into a string as the file name after uploading and set the save path and pass the value to jsp Page
#4. The copy code here copies a source file to a new directory path as shown in the figure
5. The jsp file uploaded here is used to select video files and submit them to the backend
#6. Display the old file name, the new file name and the uploaded file directory path, and Passed to the parent page, index.jsp
7, the code submitted by the upload.jsp file is processed by the java file and transferred to upload_video.jsp
through control.
8. The code snippet has been posted. Next, we will start the demonstration interface and click the upload button as shown in the picture.
9. Click Select File to find the video file to be uploaded, select Open and click the OK button
10. Here is the interface that displays the old and new file names and file directory paths. Click OK to change the file directory. Pass it to the parent file interface
#11. As shown in the figure, the directory path has been given to the input. Click the play button, the playback interface will appear and the playback will occur automatically
Related learning recommendations:Programming video
The above is the detailed content of How to upload video in java. For more information, please follow other related articles on the PHP Chinese website!