ASP问题,上传图片代码(200分)

  • 主题发起人 主题发起人 青山侠客
  • 开始时间 开始时间

青山侠客

Unregistered / Unconfirmed
GUEST, unregistred user!
请看下面的两个文件,典型表格(含图片文件)上传,为什么图片文件不能上传呢?
文件1:付费设计信息表.htm
<html>
<head>
<meta http-equiv="Content-Language" content="zh-cn">
<meta http-equiv="Content-Type" content="text/html;
charset=gb2312">
<title>设计信息表</title>
<!--mstheme--><link rel="stylesheet" type="text/css" href="_themes/journal/jour1000-106.css"><meta name="Microsoft Theme" content="journal 1000, default">
</head>
<body>
<P>
<b><font color="#000000" size="6" face="黑体">      &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
设计信息表</font></b></P>
<FORM METHOD="POST" action="免费设计信息处理.asp" enctype="multipart/form-data">
<input TYPE="hidden" NAME="VTI-GROUP" VALUE="0" >

<fieldset style="width: 706px;
height: 163px;
padding: 2">
<legend align="center">个人信息</legend>
<TABLE id="table1" height="136" width="700">
<TR><TD width="91" height="30">用户:</TD><TD height="30">
<input type="text" name="name" size="16">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
性别:<input type="radio" value="男" checked name="xingbie">男<input type="radio" name="xingbie" value="女">女</TD></TR><TR>
<TD width="91" height="30">年龄:</TD><TD height="30">
<input type="text" name="nianling" size="16">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
职业:<input type="text" name="zhiye" size="16"></TD></TR><TR>
<TD width="91" height="32">颜色偏好:</TD><TD height="32"><select size="1" name="ysph">
<option selected>无</option>
<option>红</option>
<option>橙</option>
<option>黄</option>
<option>绿</option>
<option>蓝</option>
<option>青</option>
<option>紫</option>
</select>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
爱好:<input type="text" name="aihao" size="16"></TD></TR><TR>
<TD width="91">联系方式:</TD><TD>E-mail:<input type="text" name="Email" size="16"><span style="font-size: 10px">&nbsp;&nbsp;&nbsp;&nbsp;
</span>QQ:&nbsp;
<input type="text" name="QQ" size="16">&nbsp;&nbsp;&nbsp;
电话:<input type="text" name="tel" size="16"></TD></TR></TABLE>
</fieldset><br>
<fieldset style="width: 606px;
height: 189px;
padding: 2">
<legend align="center">房屋信息</legend>
<TABLE id="table2" height="201" width="700">
<tr>
<TD width="93">吊顶:</TD><TD height="21"><select size="1" name="diaoding">
<option selected>局部吊顶</option>
<option>不吊顶</option>
<option>满吊顶</option>
</select></TD>
</tr>
<tr>
<TD width="93">背景墙:</TD><TD height="22">
<input type="checkbox" name="ysbjq" value="做">影视背景墙&nbsp;&nbsp;
<input type="checkbox" name="sfbjq" value="做">沙发背景墙&nbsp;&nbsp;
<input type="checkbox" name="ctbjq" value="做">餐厅背景墙</TD>
</tr>
<tr>
<TD width="93">地面:</TD><TD height="21">客厅:<select size="1" name="ktdm">
<option selected>抛光地砖</option>
<option>仿古地砖</option>
<option>实木地板</option>
<option>强化地板</option>
</select>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
餐厅:<select size="1" name="ctdm">
<option selected>抛光地砖</option>
<option>仿古地砖</option>
<option>实木地板</option>
<option>强化地板</option>
</select></TD>
</tr>
<tr>
<TD width="93">家具色调:</TD><TD height="21"><select size="1" name="jjsd">
<option>白漆</option>
<option>柚木清漆</option>
<option>黑胡桃清漆</option>
<option>按设计风格配</option>
</select></TD>
</tr>
<tr>
<TD width="93">设计风格:</TD><TD height="21"><select size="1" name="sjfg">
<option>白色物语</option>
<option>现代前卫</option>
<option>简约灵动</option>
<option>古典意蕴</option>
<option>地中海风情</option>
<option>华丽古典</option>
<option>清新雅致</option>
<option>欧陆风尚</option>
</select></TD>
</tr>
<tr>
<TD width="93">户型结构图:</TD><TD height="34">
<input type="file" name="hxjgt" size="20"></TD>
</tr>
<tr>
<TD width="93">其他要求:</TD><TD height="45" width="597">
<textarea rows="3" name="qtyq" cols="70"></textarea></TD>
</tr>
</TABLE>
</fieldset><div style="position: absolute;
width: 537px;
height: 28px;
z-index: 1;
left: 176px;
top: 489px" id="layer1">
<font size="2" color="#0000FF">
备注:免费设计仅根据你的要求和户型结构图设计一张限定风格效果图,若要多种风格的详细设计请选付费设计,价格优惠!</font></div>
<p>
<INPUT TYPE=submit VALUE="提交表单">&nbsp;&nbsp;&nbsp;
<INPUT TYPE=reset VALUE="重置" name="c">&nbsp;&nbsp;&nbsp;&nbsp;
</p>
</FORM>
<HR>
</body></html>
文件2:免费设计信息处理.asp
<% @ language="VBScript" %>
<html>
<head><title>创建文件示例</title></head>
<body>
<p>正在写文件......</p>
<%
'创建 FileSystemObject 对象实例
Set fso=Server.CreateObject("Scripting.FileSystemObject")
'创建一个文本文件并返回 TextStream对象
Set txtFile=fso.OpenTextFile(Server.MapPath("免费设计客户信息.txt"),8,True)
'对文件执行写操作
txtFile.WriteLine "客户信息表"
txtFile.Write "用户:"
txtFile.WriteLine request.querystring("name")
txtFile.Write "性别:"
txtFile.WriteLine request.querystring("xingbie")
txtFile.Write "年龄:"
txtFile.WriteLine request.querystring("nianling")
txtFile.Write "职业:"
txtFile.WriteLine request.querystring("zhiye")
txtFile.Write "颜色偏好:"
txtFile.WriteLine request.querystring("ysph")
txtFile.Write "爱好:"
txtFile.WriteLine request.querystring("aihao")
txtFile.Write "Email:"
txtFile.WriteLine request.querystring("Email")
txtFile.Write "QQ:"
txtFile.WriteLine request.querystring("QQ")
txtFile.Write "电话:"
txtFile.WriteLine request.querystring("tel")
txtFile.Write "吊顶:"
txtFile.WriteLine request.querystring("diaoding")
txtFile.Write "影视背景墙:"
txtFile.WriteLine request.querystring("ysbjq")
txtFile.Write "沙发背景墙:"
txtFile.WriteLine request.querystring("sfbjq")
txtFile.Write "餐厅背景墙:"
txtFile.WriteLine request.querystring("ctbjq")
txtFile.Write "客厅地面:"
txtFile.WriteLine request.querystring("ktdm")
txtFile.Write "餐厅地面:"
txtFile.WriteLine request.querystring("ctdm")
txtFile.Write "家具色调:"
txtFile.WriteLine request.querystring("jjsd")
txtFile.Write "设计风格:"
txtFile.WriteLine request.querystring("sjfg")
txtFile.Write "户型结构图:"
txtFile.WriteLine request.querystring("hxjgt")
txtFile.Write "其他要求:"
txtFile.WriteLine request.querystring("qtyq")
txtFile.WriteLine "__________________________________________"
txtFile.Close
%>

<%

response.buffer=true

formsize=request.totalbytes

formdata=request.binaryread(formsize)

bncrlf=chrB(13) &
chrB(10)

divider=leftB(formdata,clng(instrb(formdata,bncrlf))-1)

datastart=instrb(formdata,bncrlf &
bncrlf)+4

dataend=instrb(datastart+1,formdata,divider)-datastart

mydata=midb(formdata,datastart,dataend)



set connGraph=server.CreateObject("ADODB.connection")

connGraph.ConnectionString="driver={Microsoft Access Driver (*.mdb)};DBQ=" &

server.MapPath("upload.mdb") &
";uid=;PWD=;"

connGraph.Open



set rec=server.createobject("ADODB.recordset")

rec.Open "SELECT * FROM [images] where id is null",connGraph,1,3

rec.addnew

rec("img").appendchunk mydata

rec.update

rec.close

set rec=nothing

set connGraph=nothing

%>
<DIV ALIGN="center">
<P>文件创建成功!</P> <!--生成的poem.htm文件存放在创建它的文件 textStream.asp 同目录中。-->
<A HREF="免费设计信息表.htm">返回上一页</A>
</DIV>
</BODY>
</HTML>
 

Similar threads

S
回复
0
查看
3K
SUNSTONE的Delphi笔记
S
S
回复
0
查看
2K
SUNSTONE的Delphi笔记
S
S
回复
0
查看
937
SUNSTONE的Delphi笔记
S
后退
顶部