<%@ page language="java" import="java.util.*" pageEncoding="gbk"%>
<!DOCTYPE html>
<html>
<head lang="en">
    <meta http-equiv="Content-Type" content="text/html; charset=gbk" />
    <%@include file="../../../frame/assets/header-all.jsp"%>
    <style>
        .form-line .text-content{
            width:120px;
        }
    </style>
</head>
<body class="easyui-layout">、
<form id= "uploadForm" enctype="multipart/form-data">
    <p >指定文件名： <input type="text" name="filename" id="filename" value= ""/></p >
    <p >上传文件： <input type="file" name="file" id="file" onchange="changename()"/></p>
    <input type="button" value="上传" onclick="doUpload()" />
</form>
</body>
</html>
<script type="text/javascript">
    function changename() {
        $('#filename').val(document.getElementById('file').files[0].name);
    }
    function doUpload() {
        var formData = new FormData($( "#uploadForm" )[0]);
        $.ajax({
            url: "nhywjjzcxxAction!imp_Nhywjjzcxx.do",
            type: 'POST',
            data: formData,
            async: false,
            cache: false,
            contentType: false,
            processData: false,
            success: function (data) {
                alert(data);
            },
            error: function (data) {
                alert(data);
            }
        });
    }
</script>
