
<!--#INCLUDE FILE="fupload.inc"-->
<!--#include file="../SQLconn.asp"-->


<%
if Request.ServerVariables("REQUEST_METHOD") = "POST" Then
'---------------------------
'response.write "开始发送<br>"
'---------------------------
Dim Fields
UploadSizeLimit=21212121
Set Fields = GetUpload()
dim Field
For Each Field In Fields.Items
if Field.name="fid" then fid=BinaryToString(Field.value)
if Field.name="shuoming" then shuoming=BinaryToString(Field.value)
if Field.name="curpage" then   curpage=BinaryToString(Field.value)

if Field.name="file1" then
filename=field.FileName

fileContentType=field.ContentType
filevalue=field.value
flength=field.Length/1024/1024
end if
next

'系统提示文件大小超出范围
if flength>CINT(request.cookies("filelength"))  then
 %>  
<div align="center" class="STYLE1 STYLE3" title="提示信息框">
                <span style="BACKGROUND:#EEEEFF;COLOR:#FF6633;margin: 10px;border:1px dotted #FF6633;
				 font-weight:bold;padding:18px;width=540">
                附件 <%=FormatNumber(flength,2)%>M 太大，系统设定不能上传大于<%=request.cookies("filelength")%>M的文件。</span>                 </div>
<%   
else
 

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 gonggaopic where (id is null)" 

rsgonggao.open rsgonggaosql,conn,1,3
rsgonggao.addnew

rsgonggao("fid")=fid
rsgonggao("shuoming")=shuoming
rsgonggao("filename")=filename
rsgonggao("fileContentType")=fileContentType
rsgonggao("filevalue").appendchunk filevalue
rsgonggao.update





rsgonggao.close


response.redirect   "picture.asp?id="&fid&"&curpage="&curpage
end if 
end if%>

</body>  
  
</html>  


