日期:2014-05-18 浏览次数:20507 次
//按钮触发保存文件
function SaveFile() {
var strPath = $("#txtParent_2").html();
strPath = '../UserFile/InfoManage/' + strPath;
var strID = $("#txtID").val();
var strUserID = $("#txtUserID").val();
var strCorpCode = $("#txtCorpCode").val();
var strScript = '../CheckCode/FileManage.aspx?Mode=AddFile&DirID='+strID+"&Corp="+strCorpCode+"&UserID="+strUserID;
//'script': '../CheckCode/FileManage.aspx?Mode=AddFile&DirID='+$("#txtID").val(),
$('#uploadify').uploadifySettings('script', strScript);
//'folder': '../UserFile/'+strPath,
$('#uploadify').uploadifySettings('folder', strPath);
$('#uploadify').uploadifyUpload();
document.getElementById('apDiv8').style.display = "none";
document.getElementById('divUpFile').style.display = "none";
}
$(document).ready(function() {
$("#uploadify").uploadify({
'uploader': '../../Js/JQuery/uploadify.swf?V='+(new Date()).getTime(),
'height': '26',
'width': '74',
'buttonImg': '../../Images/Manage/xzwj.jpg',
'cancelImg': '../../Images/Manage/cancel.png',
'queueID': 'fileQueue',
//'fileDesc': '*.rar;*.jpg;*.gif',
//'fileExt': '*.rar;*.jpg;*.gif',
'sizeLimit': '400097152', //400M
'auto': false,
'multi': true,
'onError': function(a, b, c, d) {
if (d.status == 404)
alert('Could not find upload script.');
else if (d.type === "HTTP")
alert('error ' + d.type + ": " + d.status);
else if (d.type === "File Size")
{ }
},
'onComplete': function(event, queueID, fileObj, response, data) {
if (response == "0") {
alert("上传附件出错,请重试");
return;
}
var strName = fileObj.name;
/*iNum++;
var len = fileObj.size;
len = Math.round(len/1024*100)*0.01;
var m="KB";
if(len>1000)
{len=Math.round(len*0.001*100)*0.01;m="MB";}
len = len.toString() + m;
var htm="<div id=\"fileItem"+iNum+"\"><img src=\"../../Images/Manage/fj.jpg\" alt=\"附件\" border=\"0\" />"+fileObj.name+"("+len+") <a href=\"javascript:void(0);\" onclick=\"DelFile("+iNum+",'" + escape(strName)+"','../UserFile/"+strID+"')\"><img src=\"../../Images/Manage/sc.gif\" alt=\"删除\" border=\"0\"/></a></div>";
$("#fileUploaded").append(htm);*/
document.getElementById("fileQueue").style.display = "none";
var txtFileID = $("#txtTmp").val();
$("#txtTmp").val(txtFileID + "," + response);
var iTmp = strName.lastIndexOf(".");
if (iTmp > 0) {