标题:怎么限制图片的大小和图片类型
只看楼主
夜龙魂
Rank: 2
等 级:论坛游民
帖 子:130
专家分:65
注 册:2009-9-24
结帖率:57.14%
 问题点数:0 回复次数:0 
怎么限制图片的大小和图片类型
怎么限制图片的大小和图片类型

index.asp
<%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.
<html xmlns="http://www.
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
</head>

<body>
<form action="sava.asp" method="post" enctype="multipart/form-data">
  <input type="file" name="imgurl">
  <input type="submit" name=ok value="提交">
</form>
</body>
</html>

sava.asp

<%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%>
<!--#include file="conn.asp"-->
<%
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 rs=server.createobject("ADODB.recordset")
rs.open "SELECT * FROM imgurl",conn,3,2
rs.addnew
rs("img").AppendChunk mydata
rs.update
rs.close
set rs=nothing
set conn=nothing
response.redirect "index.asp"
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.
<html xmlns="http://www.
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
</head>

<body>

</body>
</html>
搜索更多相关主题的帖子: 类型 
2009-11-19 11:00



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-292823-1-1.html




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

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