日期:2014-05-17  浏览次数:21247 次

上传图片文件,怎么显示不出来呢,怀疑是上传的时候就有问题。
d6.asp文件代码如下:
VBScript code

<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title></title>
</head>
<body>
<form action="d7.asp" method="post" enctype="multipart/form-data" name="form1" id="form1">
  <table width="429" border="1" align="center" cellpadding="4" cellspacing="0" rules="none">
    <tr>
      <th width="417" scope="col">上传照片</th>
    </tr>
    <tr>
      <td height="60" align="center">选择图片所在的文件:
        <input type="file" name="tupian1" id="tupian1" /></td>
    </tr>
    <tr>
<td align="center">
<input type="submit" name="button" id="button" value="开始上传"></td>
    </tr>
  </table>
</form>
</body>
</html>


d7.asp文件代码如下:
HTML code

<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<!--#include file="conn.asp" -->
<%
dim ccc,ddd
ccc="select * from shangchuan"
set ddd=server.createobject("adodb.recordset")
ddd.open ccc,aaa,1,3
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title></title>
</head>
<body>
<%
a1=request.TotalBytes
a2=request.BinaryRead(a1)
a3=chr(13)&chr(10)
a4=left(a2,clng(instr(a2,a3)))
response.write(a4)
a5=instr(a2,a3&a3)+4
response.write(a5)
a6=instr(a5+1,a2,a4)-a5
response.write(a6)
a7=mid(a2,a5,a6)
response.write(a7)
ddd.addnew
ddd("photo").AppendChunk a7
ddd.update
ddd.close
%>
</body>
</html>


\\\\\\\\\\\\\\\\\\\\\\\\\\\\
求助:存入数据库的数据可能有问题,我测试了就是不知道那里的事呢?
【下边是显示页面:】
d9.asp文件代码如下:
VBScript code

<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<!--#include file="conn.asp" -->
<%
dim ccc,ddd
ccc="select * from shangchuan"
set ddd=server.createobject("adodb.recordset")
ddd.open ccc,aaa,1,3
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title></title>
</head>
<body>
<%
do while not ddd.eof
%>
<img src="d8.asp?xuhao=<%=ddd("id")%>">
<%
ddd.MoveNext
loop
%>
</body>
</html>


d8.asp文件代码如下:
VBScript code

<!--#include file="conn.asp" -->
<%
dim ccc,ddd
ccc="select * from shangchuan where id='"&request("xuhao")&"'"
set ddd=server.createobject("adodb.recordset")
ddd.open ccc,aaa,1,3
%>
<%
response.ContentType="image/*"
response.BinaryWrite ddd("photo").getChunk(8000000)
%>


\\\\\\\\\\\\\\\\\\\\\\\\\
请路过的前辈帮助:先谢谢啊。

------解决方案--------------------
先看看是否已经正确上传了