<!--#include file="../checkLogin.asp"-->
<!--#include file="../SQLconn.asp"-->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>保存文件</title>


<link rel="stylesheet" type="text/css" href="../images/<%=request.cookies("imgdir")%>/css/style.css" media="all"/>
</head>
<body  topmargin="5" leftmargin="5">

<p>
<%
Set Upload=Server.createobject("Persits.Upload.1") 
uploadlimitsize=request.cookies("filelength")                             '改变这个设置可以改变上传文件的大小限制，单位兆。
Upload.SetMaxSize uploadlimitsize*1024*1024, True 
Upload.Save  
if err.number <> 0 then 
response.write  "出现错误: " & err.number & "、" & err.description &"" 
end if 
if err.number = 8 then 
response.write " 你上传的文件超过限制（"& uploadlimitsize &"兆）<a href=""javascript:history.go(-1)"">重新上传</a>" 
response.end 
end if 


	   fid=Upload.Form("id").value
	   curpage=Upload.Form("curpage").value
	   
	   shenpiren=Upload.Form("shenpiren").value
	   
	   laiwendanwei=Upload.Form("laiwendanwei").value
	   laiwenbianhao=Upload.Form("laiwenbianhao").value
	   laiweiriqi=Upload.Form("laiweiriqi").value
	   title=Upload.Form("title").value
	   xiaoneibianhao=Upload.Form("xiaoneibianhao").value
	   faburen=Upload.Form("faburen").value
	   faburiqi=Upload.Form("faburiqi").value
	   content=Upload.Form("content").value
    
		set FileObj1=Upload.Files("file1") 
		set FileObj2=Upload.Files("file2") 
		set FileObj3=Upload.Files("file3") 
		set FileObj4=Upload.Files("file4") 
		set FileObj5=Upload.Files("file5") 

 
 		    




 

 
			dim rsgonggaosql
			dim rsgonggao
			
			dim filename
			
			
			dim strdateandtime
			if  dateandtime<>"" then
			   strdate=cdate(dateandtime)
			else  
			   strNow=now()
			 end if

			
		
			
			set rsgonggao=server.createobject("adodb.recordset")
			rsgonggaosql="select * from GongWen where   id='"&fid& "'" 			
			rsgonggao.open rsgonggaosql,conn,1,3
			 
			

			rsgonggao("签署领导")=shenpiren
            rsgonggao("来文单位")=laiwendanwei
			rsgonggao("来文编号")=laiwenbianhao
			rsgonggao("来文日期")=laiweiriqi
			
			rsgonggao("编号")=xiaoneibianhao
			rsgonggao("发布人")=faburen
			rsgonggao("发布日期")=faburiqi
			
			rsgonggao("标题")=title
			rsgonggao("内容")=content

			
			
 
			rsgonggao("upDatetime")="0"
		    rsgonggao("upname")=request.cookies("tname")
			strip=Request.ServerVariables("REMOTE_ADDR")
			rsgonggao("IP")=strip
			rsgonggao.update
			
			
			
			
			
			FileName1=FileObj1.FileName
			IF FileName1<>"" THEN
						sql="select * from GongWenFile where (id is null)"
						Set rs= Server.CreateObject("ADODB.Recordset")
						rs.open sql,conn,1,3
						rs.addnew 
						rs("fid")=fid
						rs("filename")=FileObj1.FileName
						rs("fileContentType")=FileObj1.ContentType
						rs("filevalue").appendchunk FileObj1.Binary
						rs("FileLength")= FormatNumber(FileObj1.Size/1024/1024,2)
						rs.update 
						rs.close 
			end if 
			
			FileName2=FileObj2.FileName
			IF FileName2<>"" THEN
						sql="select * from GongWenFile where (id is null)"
						Set rs= Server.CreateObject("ADODB.Recordset")
						rs.open sql,conn,1,3
						rs.addnew 
						rs("fid")=fid
						rs("filename")=FileObj2.FileName
						rs("fileContentType")=FileObj2.ContentType
						rs("filevalue").appendchunk FileObj2.Binary
						rs("FileLength")= FormatNumber(FileObj2.Size/1024/1024,2)
						rs.update 
						rs.close 
			end if 
			
			FileName3=FileObj3.FileName
			IF FileName3<>"" THEN
						sql="select * from GongWenFile where (id is null)"
						Set rs= Server.CreateObject("ADODB.Recordset")
						rs.open sql,conn,1,3
						rs.addnew 
						rs("fid")=fid
						rs("filename")=FileObj3.FileName
						rs("fileContentType")=FileObj3.ContentType
						rs("filevalue").appendchunk FileObj3.Binary
						rs("FileLength")= FormatNumber(FileObj3.Size/1024/1024,2)
						rs.update 
						rs.close 
			end if 
			
			FileName4=FileObj4.FileName
			IF FileName4<>"" THEN
						sql="select * from GongWenFile where (id is null)"
						Set rs= Server.CreateObject("ADODB.Recordset")
						rs.open sql,conn,1,3
						rs.addnew 
						rs("fid")=fid
						rs("filename")=FileObj4.FileName
						rs("fileContentType")=FileObj4.ContentType
						rs("filevalue").appendchunk FileObj4.Binary
						rs("FileLength")= FormatNumber(FileObj4.Size/1024/1024,2)
						rs.update 
						rs.close 
			end if 
			
			FileName5=FileObj5.FileName
			IF FileName5<>"" THEN
						sql="select * from GongWenFile where (id is null)"
						Set rs= Server.CreateObject("ADODB.Recordset")
						rs.open sql,conn,1,3
						rs.addnew 
						rs("fid")=fid
						rs("filename")=FileObj5.FileName
						rs("fileContentType")=FileObj5.ContentType
						rs("filevalue").appendchunk FileObj5.Binary
						rs("FileLength")= FormatNumber(FileObj5.Size/1024/1024,2)
						rs.update 
						rs.close 
			end if 
		
			rsgonggao.close
			
			 
			Upload.Dispose ' 释放内存 
			Set Upload = Nothing 



	Set MyOAASPObj = Server.CreateObject("YFSchoolOApro.YFSchoolDll")
           call  MyOAASPObj.SendToOAJingLing("公文",fid)
		    set MyOAASPObj=nothing
  
   
			%>
</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<div align="center">



  <table border="1" cellspacing="0" width="700" bordercolorlight="#11B1FF" bordercolordark="#F0F8FF">
    <tr>
      <td width="100%" height="32">
      <p align="center" class="STYLE1 STYLE2">修改公文成功</td>
    </tr>
    <tr>
      <td width="100%">
        <p align="center"><br>
          <span class="STYLE1 STYLE2">
          <%response.write title%>
          </span> <span class="STYLE3">已经成功修改！！</span></p>
        <p align="left"><span class="STYLE1 STYLE2"><br>
          <br>
         新附件为：   <br>
          <br>
          <%response.write filename1%>
          <br>
          <%response.write filename2%>
          <br>
          <%response.write filename3%>
          <br>
          <%response.write filename4%>
          <br>
          <%response.write filename5%> 
          <br>
          
    <center>
    <form name="form1" method="post" action="">
      <label>
	
        <div align="center" class="STYLE1">
		<input name="button" type="button" class="topanniu" onClick="location='manage.asp?curpage=<%curpage%>'"  value="返回" />
		&nbsp;</div>
      </label>
      
    </form>
    <p align="center"><br>
    <br>
    </p>      </td>
    </tr>
  </table>
</div>

</body>  
  
</html>  



