<SCRIPT LANGUAGE="JavaScript">
<!--
var width = 300; //设置层 宽
var height = 300; // 设置层 高
function init(){
document.all.im.width = width;
document.all.im.height = height;
}
function a( e ){
document.all.im.src = e.src;
document.all.d.style.left = event.x;
document.all.d.style.top = event.y;
document.all.d.style.display = "";
}
</div>
本例子使用了jspsmart组件进行上传,这里可以免费下载该组件www.jspsmart.com
下载解压后,将jar包复制到 \WEB-INF\lib 目录后重启服务器,jspsmart即可正常使用了
1、uploadimage.jsp
<%@ page contentType="text/html;charset=gb2312" language="java" import="java.io.*,java.awt.Image,java.awt.image.*,com.sun.image.codec.jpeg.*,
java.sql.*,com.jspsmart.upload.*,java.util.*,cn.oof.database.*,cn.oof.house.*"%>
<%
SmartUpload mySmartUpload =new SmartUpload();
下载解压后,将jar包复制到 \WEB-INF\lib 目录后重启服务器,jspsmart即可正常使用了
1、uploadimage.jsp
<%@ page contentType="text/html;charset=gb2312" language="java" import="java.io.*,java.awt.Image,java.awt.image.*,com.sun.image.codec.jpeg.*,
java.sql.*,com.jspsmart.upload.*,java.util.*,cn.oof.database.*,cn.oof.house.*"%>
<%
SmartUpload mySmartUpload =new SmartUpload();
Tags: 缩略图