日期:2014-05-19 浏览次数:20763 次
<%@ page contentType="text/html; charset=utf-8" pageEncoding="utf-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>上传文件</title>
<script src="../js/jquery.js" type="text/javascript"></script>
<script src="../js/jquery.form.js" type="text/javascript"></script>
<script language="javascript">
$(document).ready(function(){
var validateForm = function() {
var fileName = $('#theFile').val();
var m=parseInt(fileName.toString().lastIndexOf("."))+1;
var extVal=fileName.toString().substr(m);
if(extVal!="doc") {
alert('文件类型必须为Word文件!');
return false;
}
$('#upMessage').html('文件上传中,请等待... ...');
return true;
};
var showResponse = function(data,status) {
$('#upMessage').fadeIn("fast",function(){
});
return true;
};
var options={
target : '#upMessage',
url : 'uploadProjectDemandFile',
beforeSubmit: validateForm,
success : showResponse,
resetForm: true
};
var validateForm1 = function() {
var fileName = $('#theFile1').val();
var m=parseInt(fileName.toString().lastIndexOf("."))+1;
var extVal=fileName.toString().substr(m);
if(extVal!="rar") {
alert('文件类型必须为压缩文件!');
return false;
}
$('#upMessage1').html('文件上传中,请等待... ...');
return true;
};
var showResponse1 = function(data,status) {
$('#upMessage1').fadeIn("fast",function(){
});
return true;
};
var options1={
target : '#upMessage1',
url :&