1、实现源代码

<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head> <title>uploadify上传图片</title> <meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page">
<link type="text/css" rel="stylesheet" href="../../js/uploadify/uploadify.css"/>
<script type="text/javascript" src="../../js/jquery-1.12.3.js"></script>
<script type="text/javascript" src="../../js/uploadify/jquery.uploadify.js"></script>
<script type="text/javascript">
$(function(){
$("#upload").uploadify({
'height': 25,
'width': 100,
'auto': true,
'removeTimeout' : 10,
'buttonText': '上传图片',
'fileTypeExts': '*.gif; *.jpg; *.png',
'fileSizeLimit' : '1MB',
'swf': '../../js/uploadify/uploadify.swf',
'uploader': '../../js/uploadify/uploadify.php',
'cancelImg': '../../js/uploadify/uploadify-cancel.png',
'buttonImage' : '../../images/img.PNG',
'multi': false,
'onUploadSuccess':function(file){
console.log(file.name);
$("#imgs").css("display","block");
$("#imgs").attr("src",file.name);
}
});
});
</script> </head> <body>
<input type="file" name="upload" id="upload" />
<img id="imgs" style="width:100px; height: 100px; display: none;">
</body>
</html>

2、实现结果

最新文章

  1. Xcode同一个Workspace中两个工程依赖于Undefined Symbol Error
  2. SqlServer-- NULL空值处理
  3. HMC破解控制台密码
  4. GridView基础知识
  5. PHP访问MSSQL数据库(实例代码)
  6. git status message - Your branch is ahead of origin/master by X commits
  7. Windows下安装Eric5时出现的“Sorry, please install QtHelp.”问题解决办法
  8. 一、Bitmap的recycle问题
  9. JQuery语法总结和注意事项
  10. oracle 数据库连接的四种方式
  11. &lt; high performance web sites &gt; 阅读小记
  12. Apache Mina(二)
  13. angular2 学习笔记 ( app initialize 初始化 )
  14. 工作VUE布局记录
  15. 运行svn tortoiseSvn cleanup 命令失败的解决办法
  16. HTTPS和SSL握手过程(转载)
  17. POP-OOP-SOP-COP-SOA-AOP
  18. 原创:R包制作--windows
  19. 第一个react
  20. echarts中国地图散点涟漪效果

热门文章

  1. Android下的Junit测试
  2. Reverse Nodes in k-Group leetcode java
  3. TextBox_TextChanged
  4. socket bind 随机端口
  5. Oracle服务启动顺序导致ORA-12514
  6. 用vs2013开发node.js的addon.
  7. awk的使用
  8. htmlayout做的虎鲸宝宝
  9. PHP高级教程-过滤器
  10. PHP高级教程-Error