| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 569 人关注过本帖
标题:图片上传问题
只看楼主 加入收藏
labid
Rank: 1
等 级:新手上路
帖 子:151
专家分:0
注 册:2006-6-20
收藏
 问题点数:0 回复次数:5 
图片上传问题

<!--#include file="strconnection.asp"-->
<!--#include file="session.asp"-->
<!--#include file="inc.asp"-->
<%

if request("action")="sava" then
Set rs=Server.CreateObject("ADODB.Recordset")
sql="select * from haoshu"
rs.open sql,conn,3,3
rs.addnew
rs("shuming")=request("title")
rs("jieshao")=request("content")
rs("zuozhe")=request("author")
rs("tupian")=request("images")

rs.update
rs.close
response.Redirect("haoshutupianadd.asp")
end if
%>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title></title>
<link href="southidc.css" rel="stylesheet" type="text/css">
<style type="text/css">
<!--
.unnamed1 {
font-size: 12px;
color: #FFFFFF;
font-weight: bold;
}
-->
</style>
</head>

<body>
<script src=adminjs.js></script>
<script language="javascript">
function chk(){
document.all("content").value=IframeID.document.body.innerHTML;
if(document.form2.title.value==""){
alert("标题不能为空");
document.form2.title.focus();
return false;}
if(document.form2.author.value==""){
alert("作者不能为空");
document.form2.author.focus();
return false;}
if(IframeID.document.body.innerHTML==""){
alert("新闻内容不能为空");
IframeID.document.body.focus();
return false;}
return true;}
</Script>
<script Language="JavaScript">
<!--
function FormCheck()
{
if (document.form2.NNsort_name.value =="")
{
alert("请输入三级分类名称!");
document.form2.NNsort_name.focus();
return false;
}
if (document.form2.NNsort_title.value =="")
{
alert("请输入二级分类名称!");
document.form2.NNsort_title.focus();
return false;
}
}
function openwin(thelink,winName,features)
{
window.open(thelink,winName,features);
return (false);
}
//-->
</script>
<form action="haoshutupianadd.asp?action=sava&types=<%=types%>" method="post" name="form2" id="form2" onSubmit="return chk();">
<table width="772" border="0" align="center" cellpadding="2" cellspacing="2" class="table_southidc">
<tr>
<td height="22" colspan="2" align="center" bgcolor="6072A4" class="back_southidc"><font color="#FFFFFF"><strong><%=types%>添加</strong></font></td>
</tr>
<tr>
<td width="86" height="24" bgcolor="D6DFF9"><div align="left">书名:</div></td>
<td bgcolor="E7EDFC"><input name="title" type="text" id="title" size="30">
</td>
</tr>
<tr>
<td height="11" align="center" bgcolor="D6DFF9"> <div align="left">作者:</div></td>
<td height="11" align="center" bgcolor="E7EDFC"><div align="left">
<input name="author" type="text" id="author">
</div></td>
</tr>

<tr>
<td height="-1" align="center" bgcolor="D6DFF9"><div align="left">图片文件:</div></td>
<td height="4" align="center" bgcolor="E7EDFC"><div align="left">
<input name="images" type="text" id="images">
</div></td>
</tr>
<tr>
<td height="31" align="center" bgcolor="D6DFF9"> <div align="left">上传图片:</div></td>
<td height="31" align="center" bgcolor="E7EDFC"> <div align="left">
<iframe frameborder=0 width=400 height=20 scrolling=no src="../upfile.asp"></iframe>
</div></td>
</tr>
<tr>
<td height="10" align="center" bgcolor="D6DFF9"><div align="left">内容:</div></td>
<td height="10" align="center" bgcolor="E7EDFC"><div align="left">
<%call html()%>
<textarea name="content" id="content" style=display:none></textarea>
</div></td>
</tr>
<tr>
<td height="10" colspan="2" align="center"><input type="submit" name="Submit" value="确定保存"></td>
</tr>
</table>
</form>
</body>
</html>





以上是代码:
报错是报的是`````rs("tupian")=request("images")这行!
内容是:
Microsoft OLE DB Provider for SQL Server (0x80040E21)
多步 OLE DB 操作产生错误。如果可能,请检查每个 OLE DB 状态值。没有工作被完成。
/gongan/admin/haoshutupianadd.asp, 第 14 行



哪位高手哥哥给我讲讲,谢谢!~~~~~~!

搜索更多相关主题的帖子: request include file asp 
2006-07-08 01:02
icecool
Rank: 9Rank: 9Rank: 9
等 级:贵宾
威 望:20
帖 子:1214
专家分:1366
注 册:2005-3-14
收藏
得分:0 

上传图片哪有这样简单,

而且上传数据也不是REQUEST("")能接暇到的


http://toorup.3v.do
loading...
2006-07-08 08:43
labid
Rank: 1
等 级:新手上路
帖 子:151
专家分:0
注 册:2006-6-20
收藏
得分:0 
不是啊,哥哥
我已经在这里面调用了组件了,就是获取数据库存储URL的时候有错
2006-07-08 10:29
icecool
Rank: 9Rank: 9Rank: 9
等 级:贵宾
威 望:20
帖 子:1214
专家分:1366
注 册:2005-3-14
收藏
得分:0 

你现在是要往数据库里保存什么? tupian字段是什么数据类型?

request("images")是二进制数据了?

如果是把rs("tupian")=request("images")换成下面试试呢

rs("tupian").AppendChunk request("images")


http://toorup.3v.do
loading...
2006-07-08 10:55
ggchen
Rank: 1
等 级:新手上路
帖 子:5
专家分:0
注 册:2006-7-7
收藏
得分:0 
我考虑的问题是怎么把上传的图片自动生成一个小象素的缩微图,这样打开网页就快多了
2006-07-08 13:38
labid
Rank: 1
等 级:新手上路
帖 子:151
专家分:0
注 册:2006-6-20
收藏
得分:0 

谢谢`````icecool
我弄起了,非常感谢``````

2006-07-09 02:19
快速回复:图片上传问题
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.022268 second(s), 7 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved