请问如何限制上传图片的长宽?急啊

来源:百度知道 编辑:UC知道 时间:2024/04/29 23:08:47
请问如何限制上传图片的长宽?
或者是是图片以一定比例缩略显示?
我在上传图片后,发现上传的图片以原始尺寸:1024*768显示在网页中,结果把网页撑散了,在显示图片的地方是以
<%=DefaultPic%>输出的,上传页只队图片大小做了限制,没有限制长宽,我如何设置才能使所有上传的图片以一定的比例如:长150*宽120缩略显示在网页中呢?
这是上传页面的代码:
<!--#include file="const.asp"-->
<html>
<head>
<title>图片上传</title>
<meta HTTP-EQUIV="Content-Type" content="text/html; charset=gb2312">
<link href="inc/style.css" rel="stylesheet" type="text/css">
</head>

<body>
<table width="100%" border="0" cellspacing="0" cellpadding="0" bordercolor="#CCCCCC">
<tr> <form name="forms1" method="post" action="uploadsave1.asp" enctype="multipart/form-data">
<td valign="middle">
<input type="file" nam

和上传没有关系
是你显示的时候这样写
response.write "<img scr='' height=xx weight=xx>"
加上长宽限制就可以了!

用一个小光盘把照片上传到电脑上就可以了嘛!不用大费周章!