<!--#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("fid").value
			curpage=Upload.Form("curpage").value
		    
			set FileObj1=Upload.Files("file1") 

 
 
		dim rsgonggaosql
		dim rsgonggao
		
		dim filename
		
		'dim strtype 
		dim strdateandtime
		if  dateandtime<>"" then
		   strdate=cdate(dateandtime)
		else  
		   strNow=now()
		 end if
		 
		
		
		set rsgonggao=server.createobject("adodb.recordset")
		rsgonggaosql="select * from zuoyebuzhiFile where (id is null)" 
		
		rsgonggao.open rsgonggaosql,conn,1,3
		rsgonggao.addnew
		
		rsgonggao("fid")=fid
		rsgonggao("filename")=FileObj1.FileName
		rsgonggao("fileContentType")=FileObj1.ContentType
		rsgonggao("filevalue").appendchunk FileObj1.Binary
		rsgonggao("FileLength")= FormatNumber(FileObj1.Size/1024/1024,2)
		rsgonggao.update
		
		
		
		
		
		rsgonggao.close
		
		Upload.Dispose ' 释放内存 
		Set Upload = Nothing 
		
		
		response.redirect   "fujian.asp?fid="&fid&"&curpage="&curpage


%>

</body>  
  
</html>  


