关于上传的一个有关问题
关于上传的一个问题
下面是我的代码
<!--#include file="conn1.asp" -->
<!--#include file="UpLoad_Class.asp"-->
<meta http-equiv="content-type" content="text/html; charset=gb2312" />
<TITLE>施工进度添加</TITLE>
<link href="skins/css/main.css" rel="stylesheet" type="text/css" />
<form action="" method=post name="form" enctype="multipart/form-data">
<table width="80%" border="0" align="center" cellpadding="3" cellspacing="1">
<tr>
<td width="27%" class="td2"><div align="center">施工队别</div></td>
<td width="73%" class="td1">
<input name="db" type="text" id="db" size="10" /></td>
</tr>
<tr>
<td width="27%" class="td2"><div align="center">井 别</div></td>
<td width="73%" class="td1">
<select name="cb" id="cb">
<option value="水">水</option>
<option value="油">油</option>
</select> </tr>
<tr>
<td width="27%" class="td2"><div align="center">地质方案</div></td>
<td width="73%" class="td1">
<input name="dzfaysmc" type="text" id="dzfaysmc" size="10" />
<input name="dzfascmc" type="file" id="dzfascmc" /></td>
</tr>
<tr>
<td width="27%" class="td2"><div align="center">工程方案</div></td>
<td width="73%" class="td1">
<input name="gcfaysmc" type="text" id="gcfaysmc" size="10" />
<input name="gcfascmc" type="file" id="gcfascmc" /></td>
</tr>
<tr>
<td width="27%" class="td2"><div align="center">地质设计</div></td>
<td width="73%" class="td1">
<input name="dzsjysmc" type="text" id="dzsjysmc" size="10" />
<input name="dzsjscmc" type="file" id="dzsjscmc" /></td>
</tr>
<tr>
<td width="27%" class="td2"><div align="center"> </div></td>
<td width="73%" class="td1"><input name="submit1" type="submit" value="添加" > </td>
</tr>
</table>
</form>
<%if request.form="添加" then
dim upload
dim file,savpath
set upload = new AnUpLoad
upload.Exe = "*"
upload.MaxSize = 2 * 1024 * 1024 '2M
upload.GetData()
if upload.ErrorID>0 then
response.Write upload.Description
else
savepath = "upload"
set file = upload.files("dzfaysmc")
if file.isfile then
result = file.saveToFile(savepath,0,true)
if result then
response.Write "文件'" & file.LocalName & "'上传成功,保存位置'" & server.MapPath(savepath & "/" & file.filename) & "',文件大小" & file.size & "字节"
response.End()
'session("dzfaysmc")="1"
dzfascmc=file.filename
else
response.Write file.Exception
end if
end if
end if
'set upload = nothing
sql="select * from [djsgtj]"
set rs=server.CreateObject("adodb.recordset")
rs.open sql,conn,1,3
rs.addnew()
rs("jh_id")=jh_id
rs("db")=trim(TxtShift(upload.form("db")))
rs("cb")=trim(TxtShift(upload.form("cb")))
rs("jb")=upload.form("jb")
rs("dzfaysmc")=dzfaysmc
rs("dzfascmc")=dzfascmc
rs.update
rs.close
%>
<script language="javascript">
alert("单井施工统计保存成功!");
</script>
<%end if%>
为什么当我点击添加的时候,页面出现如下错误
“Internet Explorer 无法显示该页面”
•Internet 连接已丢失。
•该网站暂时不可用。
•无法连接到域名服务器(DNS)。
•域名服务器(DNS)没有该网站的域的列表。
•在地址中可能存在键入错误。
下面是我的代码
<!--#include file="conn1.asp" -->
<!--#include file="UpLoad_Class.asp"-->
<meta http-equiv="content-type" content="text/html; charset=gb2312" />
<TITLE>施工进度添加</TITLE>
<link href="skins/css/main.css" rel="stylesheet" type="text/css" />
<form action="" method=post name="form" enctype="multipart/form-data">
<table width="80%" border="0" align="center" cellpadding="3" cellspacing="1">
<tr>
<td width="27%" class="td2"><div align="center">施工队别</div></td>
<td width="73%" class="td1">
<input name="db" type="text" id="db" size="10" /></td>
</tr>
<tr>
<td width="27%" class="td2"><div align="center">井 别</div></td>
<td width="73%" class="td1">
<select name="cb" id="cb">
<option value="水">水</option>
<option value="油">油</option>
</select> </tr>
<tr>
<td width="27%" class="td2"><div align="center">地质方案</div></td>
<td width="73%" class="td1">
<input name="dzfaysmc" type="text" id="dzfaysmc" size="10" />
<input name="dzfascmc" type="file" id="dzfascmc" /></td>
</tr>
<tr>
<td width="27%" class="td2"><div align="center">工程方案</div></td>
<td width="73%" class="td1">
<input name="gcfaysmc" type="text" id="gcfaysmc" size="10" />
<input name="gcfascmc" type="file" id="gcfascmc" /></td>
</tr>
<tr>
<td width="27%" class="td2"><div align="center">地质设计</div></td>
<td width="73%" class="td1">
<input name="dzsjysmc" type="text" id="dzsjysmc" size="10" />
<input name="dzsjscmc" type="file" id="dzsjscmc" /></td>
</tr>
<tr>
<td width="27%" class="td2"><div align="center"> </div></td>
<td width="73%" class="td1"><input name="submit1" type="submit" value="添加" > </td>
</tr>
</table>
</form>
<%if request.form="添加" then
dim upload
dim file,savpath
set upload = new AnUpLoad
upload.Exe = "*"
upload.MaxSize = 2 * 1024 * 1024 '2M
upload.GetData()
if upload.ErrorID>0 then
response.Write upload.Description
else
savepath = "upload"
set file = upload.files("dzfaysmc")
if file.isfile then
result = file.saveToFile(savepath,0,true)
if result then
response.Write "文件'" & file.LocalName & "'上传成功,保存位置'" & server.MapPath(savepath & "/" & file.filename) & "',文件大小" & file.size & "字节"
response.End()
'session("dzfaysmc")="1"
dzfascmc=file.filename
else
response.Write file.Exception
end if
end if
end if
'set upload = nothing
sql="select * from [djsgtj]"
set rs=server.CreateObject("adodb.recordset")
rs.open sql,conn,1,3
rs.addnew()
rs("jh_id")=jh_id
rs("db")=trim(TxtShift(upload.form("db")))
rs("cb")=trim(TxtShift(upload.form("cb")))
rs("jb")=upload.form("jb")
rs("dzfaysmc")=dzfaysmc
rs("dzfascmc")=dzfascmc
rs.update
rs.close
%>
<script language="javascript">
alert("单井施工统计保存成功!");
</script>
<%end if%>
为什么当我点击添加的时候,页面出现如下错误
“Internet Explorer 无法显示该页面”
•Internet 连接已丢失。
•该网站暂时不可用。
•无法连接到域名服务器(DNS)。
•域名服务器(DNS)没有该网站的域的列表。
•在地址中可能存在键入错误。