JavaScript File Upload: JavaScript encoding for multiple file uploads

Source: Internet
Author: User
Tags object file upload string

JavaScript encoding for multiple file uploads
A Skills:
Each time dynamically add a file on the transfer box, it and delete button placed in a separate div, and the button to delete the OnClick event to respond to delete the button to remove the div.
<%@ page language= "java" import= "java.util.*" pageencoding= "Utf-8"%>
<%
String path =request.getcontextpath ();
String basepath = request.getscheme () + "://" +request.getservername () + ":" +request.getserverport () +path+ "/";
%>

<! DOCTYPE HTML Public "-//w3c//dtdhtml 4.01 transitional//en" >
<base href= "<%=basePath%>" >

<title> upload page </title>

<meta http-equiv= "Pragma" content= "No-cache" >
<meta http-equiv= "Cache-control" content= "No-cache" >
<meta http-equiv= "Expires" content= "0" >
<meta http-equiv= "keywords" content= "keyword1,keyword2,keyword3" >
<meta http-equiv= "description" content= "This are my page" >
<!--
<link rel= "stylesheet" type= "Text/css"
href= "Styles.css" >
-->
<script type= "Text/javascript" >
function AddFile () {
Gets the element object to the specified ID
var files = document.getElementById ("Files");
Create an Element object
var input = document.createelement ("input");
Attributes of an element
Input.name= "File"; This article links http://www.cxybl.com/html/wyzz/JavaScript_Ajax/20121117/33930.html

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.